[vlc-devel] commit: Qt/playlist: fix memleak. ( Rémi Duraffort )
git version control
git at videolan.org
Wed Oct 29 22:21:34 CET 2008
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Oct 29 22:01:34 2008 +0100| [b4adbba8586661abb982e0491d52b2c30138c9c0] | committer: Rémi Duraffort
Qt/playlist: fix memleak.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b4adbba8586661abb982e0491d52b2c30138c9c0
---
.../gui/qt4/components/playlist/playlist_model.cpp | 2 +-
.../gui/qt4/components/playlist/playlist_model.hpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index e22a662..dde688e 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -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;
}
diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
index 3f2d541..b3c6d80 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
@@ -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;
More information about the vlc-devel
mailing list