[vlc-commits] dash: MPD manager factory: fixing a potential memory leak
Hugo Beauzée-Luyssen
git at videolan.org
Fri Dec 2 00:24:11 CET 2011
vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Mon Nov 28 17:21:02 2011 +0100| [1e124d2c28bb6bb42282bdd2ce7316c31e3d5da4] | committer: Jean-Baptiste Kempf
dash: MPD manager factory: fixing a potential memory leak
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 3852dd54533838e2c5116405012e62659e7a5365)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=1e124d2c28bb6bb42282bdd2ce7316c31e3d5da4
---
.../stream_filter/dash/mpd/MPDManagerFactory.cpp | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp b/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
index 9412acf..e3cbca1 100644
--- a/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
+++ b/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
@@ -45,14 +45,12 @@ IMPDManager* MPDManagerFactory::create (Profile profile, Node *
IMPDManager* MPDManagerFactory::createBasicCMManager (Node *root)
{
- BasicCMParser *parser = new BasicCMParser(root);
+ BasicCMParser parser(root);
- if(!parser->parse())
+ if(!parser.parse())
return new NullManager();
- BasicCMManager *manager = new BasicCMManager(parser->getMPD());
-
- delete(parser);
+ BasicCMManager *manager = new BasicCMManager(parser.getMPD());
return manager;
}
More information about the vlc-commits
mailing list