[libdazzle] app: remove old merge id after removing
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] app: remove old merge id after removing
- Date: Fri, 1 Sep 2017 20:12:41 +0000 (UTC)
commit e444bc1d4c4610252207afbe3c0d737370966e16
Author: Christian Hergert <chergert redhat com>
Date: Fri Sep 1 13:12:21 2017 -0700
app: remove old merge id after removing
src/app/dzl-application.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/app/dzl-application.c b/src/app/dzl-application.c
index d10cfc1..a0c2f0a 100644
--- a/src/app/dzl-application.c
+++ b/src/app/dzl-application.c
@@ -119,7 +119,8 @@ dzl_application_real_add_resources (DzlApplication *self,
else
merge_id = dzl_menu_manager_add_filename (priv->menu_manager, menu_path, &error);
- g_hash_table_insert (priv->menu_merge_ids, (gchar *)resource_path, GUINT_TO_POINTER (merge_id));
+ if (merge_id != 0)
+ g_hash_table_insert (priv->menu_merge_ids, (gchar *)resource_path, GUINT_TO_POINTER (merge_id));
if (error != NULL &&
!(g_error_matches (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND) ||
@@ -155,7 +156,10 @@ dzl_application_real_remove_resources (DzlApplication *self,
/* Remove any merged menus from the @resource_path/gtk/menus.ui */
merge_id = GPOINTER_TO_UINT (g_hash_table_lookup (priv->menu_merge_ids, resource_path));
if (merge_id != 0)
- dzl_menu_manager_remove (priv->menu_manager, merge_id);
+ {
+ dzl_menu_manager_remove (priv->menu_manager, merge_id);
+ g_hash_table_remove (priv->menu_merge_ids, resource_path);
+ }
/* Remove keythemes path from the shortcuts manager */
keythemes_path = g_strjoin (NULL, "resource://", resource_path, "/shortcuts", NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]