Commit e873c98e authored by Matthias Clasen's avatar Matthias Clasen

action muxer: Be safe against reinsertion

Be prepared for the eventuality that somebody
might reinsert the same action group without
holding any extra references on it.

This was observed as causing crashes in
parent f8251a4d
......@@ -683,12 +683,14 @@ gtk_action_muxer_insert (GtkActionMuxer *muxer,
Group *group;
gint i;
g_object_ref (action_group);
/* TODO: diff instead of ripout and replace */
gtk_action_muxer_remove (muxer, prefix);
group = g_slice_new (Group);
group->muxer = muxer;
group->group = g_object_ref (action_group);
group->group = action_group;
group->prefix = g_strdup (prefix);
g_hash_table_insert (muxer->groups, group->prefix, group);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment