projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1bb0a89
)
g_menu_model_get_item_link: be careful with refs
author
Ryan Lortie
<desrt@desrt.ca>
Mon, 28 Nov 2011 16:44:25 +0000
(11:44 -0500)
committer
Ryan Lortie
<desrt@desrt.ca>
Thu, 8 Dec 2011 23:05:13 +0000
(18:05 -0500)
Don't unref the hashtable until after we already take the ref on the
value that was contained in the hashtable, otherwise we may kill the
value.
gio/gmenumodel.c
patch
|
blob
|
history
diff --git
a/gio/gmenumodel.c
b/gio/gmenumodel.c
index 4b6d4bc020007258deca32476440de29edfc87b8..79e73be7bfe97a157efce74b27eb7e25e1ca1591 100644
(file)
--- a/
gio/gmenumodel.c
+++ b/
gio/gmenumodel.c
@@
-393,10
+393,13
@@
g_menu_model_real_get_item_link (GMenuModel *model,
else
g_assert_not_reached ();
+ if (value != NULL)
+ g_object_ref (value);
+
if (table != NULL)
g_hash_table_unref (table);
- return value
? g_object_ref (value) : NULL
;
+ return value;
}
static void