]> git.sesse.net Git - vlc/commitdiff
Qt/playlist: fix memleak.
authorRémi Duraffort <ivoire@videolan.org>
Wed, 29 Oct 2008 21:01:34 +0000 (22:01 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Wed, 29 Oct 2008 21:01:34 +0000 (22:01 +0100)
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.hpp

index e22a6624c487a570370d923ea1aff5e1d9e2591a..dde688ebaa60cfff129af1b09142df692d84b86e 100644 (file)
@@ -993,7 +993,7 @@ static int ItemAppended( vlc_object_t *p_this, const char *psz_variable,
     playlist_add_t *p_add = (playlist_add_t *)malloc( sizeof( playlist_add_t));
     memcpy( p_add, nval.p_address, sizeof( playlist_add_t ) );
 
-    PLEvent *event = new PLEvent(  p_add );
+    PLEvent *event = new PLEvent( p_add );
     QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
     return VLC_SUCCESS;
 }
index 3f2d5412458844359459fffcbf33d93ba08d7768..b3c6d8040d0dd75016099d45e3adbdca27811ae2 100644 (file)
@@ -63,10 +63,10 @@ public:
     PLEvent( int type, int id ) : QEvent( (QEvent::Type)(type) )
     { i_id = id; p_add = NULL; };
 
-    PLEvent(  playlist_add_t  *a ) : QEvent( (QEvent::Type)(ItemAppend_Type) )
+    PLEvent( playlist_add_t  *a ) : QEvent( (QEvent::Type)(ItemAppend_Type) )
     { p_add = a; };
 
-    virtual ~PLEvent() {};
+    virtual ~PLEvent() { free( p_add ); };
 
     int i_id;
     playlist_add_t *p_add;