Commit adccbca6 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

notify: unref the notification popup after we have finished using it. fix a...

notify: unref the notification popup after we have finished using it. fix a big memory leak, and potential crashes.
parent 59198c7d
...@@ -118,6 +118,9 @@ static void Close( vlc_object_t *p_this ) ...@@ -118,6 +118,9 @@ static void Close( vlc_object_t *p_this )
var_DelCallback( p_playlist, "playlist-current", ItemChange, p_this ); var_DelCallback( p_playlist, "playlist-current", ItemChange, p_this );
pl_Release( p_this ); pl_Release( p_this );
if( p_intf->p_sys->notification )
g_object_unref( p_intf->p_sys->notification );
vlc_mutex_destroy( &p_sys->lock ); vlc_mutex_destroy( &p_sys->lock );
free( p_sys ); free( p_sys );
notify_uninit(); notify_uninit();
...@@ -266,7 +269,10 @@ static int Notify( vlc_object_t *p_this, const char *psz_temp, GdkPixbuf *pix, ...@@ -266,7 +269,10 @@ static int Notify( vlc_object_t *p_this, const char *psz_temp, GdkPixbuf *pix,
/* Close previous notification if still active */ /* Close previous notification if still active */
if( p_intf->p_sys->notification ) if( p_intf->p_sys->notification )
{
notify_notification_close( p_intf->p_sys->notification, &p_error ); notify_notification_close( p_intf->p_sys->notification, &p_error );
g_object_unref( p_intf->p_sys->notification );
}
notification = notify_notification_new( _("Now Playing"), notification = notify_notification_new( _("Now Playing"),
psz_temp, NULL, NULL); psz_temp, NULL, NULL);
......
Supports Markdown
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