Commit b4adbba8 authored by Rémi Duraffort's avatar Rémi Duraffort

Qt/playlist: fix memleak.

parent 15e4aff7
...@@ -993,7 +993,7 @@ static int ItemAppended( vlc_object_t *p_this, const char *psz_variable, ...@@ -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)); playlist_add_t *p_add = (playlist_add_t *)malloc( sizeof( playlist_add_t));
memcpy( p_add, nval.p_address, 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) ); QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -63,10 +63,10 @@ public: ...@@ -63,10 +63,10 @@ public:
PLEvent( int type, int id ) : QEvent( (QEvent::Type)(type) ) PLEvent( int type, int id ) : QEvent( (QEvent::Type)(type) )
{ i_id = id; p_add = NULL; }; { 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; }; { p_add = a; };
virtual ~PLEvent() {}; virtual ~PLEvent() { free( p_add ); };
int i_id; int i_id;
playlist_add_t *p_add; playlist_add_t *p_add;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment