[gnome-desktop] idle-monitor: Use g_clear_pointer
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop] idle-monitor: Use g_clear_pointer
- Date: Mon, 25 Mar 2013 21:27:17 +0000 (UTC)
commit fffcc2bd58f54e8e4725d9dc3a90869aa2d731cf
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Mar 25 15:55:40 2013 -0400
idle-monitor: Use g_clear_pointer
https://bugzilla.gnome.org/show_bug.cgi?id=696522
libgnome-desktop/gnome-idle-monitor.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/libgnome-desktop/gnome-idle-monitor.c b/libgnome-desktop/gnome-idle-monitor.c
index 8242945..4e6e220 100644
--- a/libgnome-desktop/gnome-idle-monitor.c
+++ b/libgnome-desktop/gnome-idle-monitor.c
@@ -298,15 +298,12 @@ gnome_idle_monitor_dispose (GObject *object)
GnomeIdleMonitor *monitor;
monitor = GNOME_IDLE_MONITOR (object);
- if (monitor->priv->watches != NULL) {
- g_hash_table_destroy (monitor->priv->watches);
- monitor->priv->watches = NULL;
- }
-
- gdk_window_remove_filter (NULL, (GdkFilterFunc)xevent_filter, monitor);
+ g_clear_pointer (&monitor->priv->watches, g_hash_table_destroy);
g_clear_object (&monitor->priv->device);
+ 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]