aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk/parser.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-01-26 15:11:16 -0600
committerTed Gould <ted@gould.cx>2011-01-26 15:11:16 -0600
commit1039a4dd88243938e8871c307c20841c375b78d2 (patch)
treea5f2df3a551f72c0ab1a3c0d1e79d13153c67863 /libdbusmenu-gtk/parser.c
parent32def89e3191d994a43d222c1e81c746922b688d (diff)
downloadlibdbusmenu-1039a4dd88243938e8871c307c20841c375b78d2.tar.gz
libdbusmenu-1039a4dd88243938e8871c307c20841c375b78d2.tar.bz2
libdbusmenu-1039a4dd88243938e8871c307c20841c375b78d2.zip
Adding comments and a check to ensure the item is valid.
Diffstat (limited to 'libdbusmenu-gtk/parser.c')
-rw-r--r--libdbusmenu-gtk/parser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index d26f8fb..1936d2d 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -85,6 +85,8 @@ dbusmenu_gtk_parse_menu_structure (GtkWidget * widget)
return NULL;
}
+/* Called when the dbusmenu item that we're keeping around
+ is finalized */
static void
dbusmenu_cache_freed (gpointer data, GObject * obj)
{
@@ -94,9 +96,12 @@ dbusmenu_cache_freed (gpointer data, GObject * obj)
return;
}
+/* Called if we replace the cache on the object with a new
+ dbusmenu menuitem */
static void
object_cache_freed (gpointer data)
{
+ if (!G_IS_OBJECT(data)) return;
g_object_weak_unref(G_OBJECT(data), dbusmenu_cache_freed, data);
return;
}