diff options
-rw-r--r-- | src/app-menu-item.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/app-menu-item.c b/src/app-menu-item.c index ece5a83..67f616a 100644 --- a/src/app-menu-item.c +++ b/src/app-menu-item.c @@ -112,6 +112,9 @@ app_menu_item_init (AppMenuItem *self) priv->desktop = NULL; priv->unreadcount = 0; + priv->client = NULL; + priv->root = NULL; + return; } @@ -122,8 +125,20 @@ app_menu_item_dispose (GObject *object) AppMenuItem * self = APP_MENU_ITEM(object); AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self); - g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), count_changed, self); - g_object_unref(priv->listener); + if (priv->listener != NULL) { + g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), count_changed, self); + g_object_unref(priv->listener); + } + + if (priv->root != NULL) { + g_object_unref(priv->root); + priv->root = NULL; + } + + if (priv->client != NULL) { + g_object_unref(priv->client); + priv->client = NULL; + } G_OBJECT_CLASS (app_menu_item_parent_class)->dispose (object); } |