mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
g_menu_model_get_item_link: be careful with refs
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.
This commit is contained in:
parent
1bb0a89de6
commit
2c4ded15e5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user