[vlc-commits] dash: MPD manager factory: fixing a potential memory leak
Hugo Beauzée-Luyssen
git at videolan.org
Thu Dec 1 22:10:40 CET 2011
vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Mon Nov 28 17:21:02 2011 +0100| [3852dd54533838e2c5116405012e62659e7a5365] | committer: Jean-Baptiste Kempf
dash: MPD manager factory: fixing a potential memory leak
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3852dd54533838e2c5116405012e62659e7a5365
---
.../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