mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-19 04:03:56 +00:00
45 lines
1.4 KiB
Diff
45 lines
1.4 KiB
Diff
|
From 222080e6d5fce85eb2a8a5c33df671bd9f21add8 Mon Sep 17 00:00:00 2001
|
||
|
From: Yegor Timoshenko <yegortimoshenko@gmail.com>
|
||
|
Date: Thu, 14 Dec 2017 22:04:04 +0000
|
||
|
Subject: [PATCH] Decrement allocation counter on item unref (#12700)
|
||
|
|
||
|
---
|
||
|
garcon/garcon-menu-item-pool.c | 7 ++++++-
|
||
|
garcon/garcon-menu-item.c | 2 ++
|
||
|
2 files changed, 8 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/garcon/garcon-menu-item-pool.c b/garcon/garcon-menu-item-pool.c
|
||
|
index 2017180..355e520 100644
|
||
|
--- a/garcon/garcon-menu-item-pool.c
|
||
|
+++ b/garcon/garcon-menu-item-pool.c
|
||
|
@@ -191,7 +191,12 @@ garcon_menu_item_pool_filter_exclude (const gchar *desktop_id,
|
||
|
g_return_val_if_fail (GARCON_IS_MENU_ITEM (item), FALSE);
|
||
|
g_return_val_if_fail (node != NULL, FALSE);
|
||
|
|
||
|
- return garcon_menu_node_tree_rule_matches (node, item);
|
||
|
+ gboolean matches = garcon_menu_node_tree_rule_matches (node, item);
|
||
|
+
|
||
|
+ if (matches)
|
||
|
+ garcon_menu_item_increment_allocated (item);
|
||
|
+
|
||
|
+ return matches;
|
||
|
}
|
||
|
|
||
|
|
||
|
diff --git a/garcon/garcon-menu-item.c b/garcon/garcon-menu-item.c
|
||
|
index 66a86bf..d61c88f 100644
|
||
|
--- a/garcon/garcon-menu-item.c
|
||
|
+++ b/garcon/garcon-menu-item.c
|
||
|
@@ -1516,6 +1516,8 @@ garcon_menu_item_unref (GarconMenuItem *item)
|
||
|
{
|
||
|
g_return_if_fail (GARCON_IS_MENU_ITEM (item));
|
||
|
|
||
|
+ garcon_menu_item_decrement_allocated (item);
|
||
|
+
|
||
|
/* Decrement the reference counter */
|
||
|
g_object_unref (G_OBJECT (item));
|
||
|
}
|
||
|
--
|
||
|
2.15.1
|
||
|
|