[gnome-desktop] idle-monitor: Don't leak the user active alarm on dispose



commit 0c60eec051e01a2ed639e592a76dd023645ac6e4
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Mar 25 13:50:10 2013 -0400

    idle-monitor: Don't leak the user active alarm on dispose
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696522

 libgnome-desktop/gnome-idle-monitor.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/libgnome-desktop/gnome-idle-monitor.c b/libgnome-desktop/gnome-idle-monitor.c
index ec9ac1d..5f1bc20 100644
--- a/libgnome-desktop/gnome-idle-monitor.c
+++ b/libgnome-desktop/gnome-idle-monitor.c
@@ -320,6 +320,11 @@ gnome_idle_monitor_dispose (GObject *object)
        g_clear_pointer (&monitor->priv->alarms, g_hash_table_destroy);
        g_clear_object (&monitor->priv->device);
 
+       if (monitor->priv->user_active_alarm != None) {
+               XSyncDestroyAlarm (monitor->priv->display, monitor->priv->user_active_alarm);
+               monitor->priv->user_active_alarm = None;
+       }
+
        gdk_window_remove_filter (NULL, (GdkFilterFunc)xevent_filter, monitor);
 
        G_OBJECT_CLASS (gnome_idle_monitor_parent_class)->dispose (object);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]