[Xfce4-commits] <parole:master> Fix a minor memory leak in the tray plugin, the plugin is not able to close notification when the daemon is notify-osd, notify_notification_close does nothing, however it works with xfce4-notifyd and notification-daemon.

Ali Abdallah noreply at xfce.org
Tue Dec 1 14:24:03 CET 2009


Updating branch refs/heads/master
         to 708a6683211511e599ecdb5033ccfbec94f1994c (commit)
       from dd33007064166e4b910e7e95172ae2bf3650b3b1 (commit)

commit 708a6683211511e599ecdb5033ccfbec94f1994c
Author: Ali Abdallah <aliov at xfce.org>
Date:   Tue Dec 1 14:05:13 2009 +0100

    Fix a minor memory leak in the tray plugin,
    the plugin is not able to close notification when the daemon is
    notify-osd, notify_notification_close does nothing, however it works
    with xfce4-notifyd and notification-daemon.

 plugins/tray/tray-provider.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/plugins/tray/tray-provider.c b/plugins/tray/tray-provider.c
index 5d5883f..0343e97 100644
--- a/plugins/tray/tray-provider.c
+++ b/plugins/tray/tray-provider.c
@@ -190,6 +190,7 @@ tray_activate_cb (GtkStatusIcon *tray_icon, TrayProvider *tray)
 static void
 notification_closed_cb (NotifyNotification *n, TrayProvider *tray)
 {
+    g_object_unref (tray->n);
     tray->n = NULL;
 }
 
@@ -313,7 +314,14 @@ state_changed_cb (ParoleProviderPlayer *player, const ParoleStream *stream, Paro
     {
 	if ( tray->n )
 	{
-	    notify_notification_close (tray->n, NULL);
+	    GError *error = NULL;
+	    notify_notification_close (tray->n, &error);
+	    if ( error )
+	    {
+		g_warning ("Failed to close notification : %s", error->message);
+		g_error_free (error);
+	    }
+	    g_object_unref (tray->n);
 	    tray->n = NULL;
 	}
 	if ( state < PAROLE_STATE_PAUSED )



More information about the Xfce4-commits mailing list