aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app-menu-item.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/app-menu-item.c b/src/app-menu-item.c
index 2f96c49..58c8a02 100644
--- a/src/app-menu-item.c
+++ b/src/app-menu-item.c
@@ -54,6 +54,7 @@ struct _AppMenuItemPrivate
DbusmenuClient * client;
DbusmenuMenuitemProxy * root;
+ GList * shortcuts;
};
#define APP_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_MENU_ITEM_TYPE, AppMenuItemPrivate))
@@ -123,10 +124,19 @@ app_menu_item_init (AppMenuItem *self)
priv->client = NULL;
priv->root = NULL;
+ priv->shortcuts = NULL;
return;
}
+/* A wrapper to make the prototypes work for GFunc */
+static void
+func_unref (gpointer data, gpointer user_data)
+{
+ g_object_unref(G_OBJECT(data));
+ return;
+}
+
/* Disconnect the count_changed signal and unref the listener */
static void
app_menu_item_dispose (GObject *object)
@@ -139,6 +149,13 @@ app_menu_item_dispose (GObject *object)
g_object_unref(priv->listener);
}
+ if (priv->shortcuts != NULL) {
+ g_list_foreach(priv->shortcuts, func_unref, NULL);
+ g_list_free(priv->shortcuts);
+ priv->shortcuts = NULL;
+ g_signal_emit(object, signals[SHORTCUTS_CHANGED], 0, TRUE);
+ }
+
if (priv->root != NULL) {
g_object_unref(priv->root);
priv->root = NULL;