]> git.sesse.net Git - vlc/commitdiff
notify: unref the notification popup after we have finished using it. fix a big memor...
authorRafaël Carré <funman@videolan.org>
Wed, 3 Oct 2007 01:27:08 +0000 (01:27 +0000)
committerRafaël Carré <funman@videolan.org>
Wed, 3 Oct 2007 01:27:08 +0000 (01:27 +0000)
modules/misc/notify/notify.c

index af017007f48a0c3e18a634f10a18388c769e8e1b..f8a56fbab0c57a6fd29d9b2ef3a8c2e64c908a81 100644 (file)
@@ -80,7 +80,7 @@ static int Open( vlc_object_t *p_this )
     intf_thread_t   *p_intf = (intf_thread_t *)p_this;
     playlist_t      *p_playlist;
     intf_sys_t      *p_sys  = malloc( sizeof( intf_sys_t ) );
+
     if( !p_sys )
     {
         msg_Err( p_intf, "Out of memory" );
@@ -118,6 +118,9 @@ static void Close( vlc_object_t *p_this )
     var_DelCallback( p_playlist, "playlist-current", ItemChange, 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 );
     free( p_sys );
     notify_uninit();
@@ -266,7 +269,10 @@ static int Notify( vlc_object_t *p_this, const char *psz_temp, GdkPixbuf *pix,
 
     /* Close previous notification if still active */
     if( p_intf->p_sys->notification )
+    {
         notify_notification_close( p_intf->p_sys->notification, &p_error );
+        g_object_unref( p_intf->p_sys->notification );
+    }
 
     notification = notify_notification_new( _("Now Playing"),
             psz_temp, NULL, NULL);