Commit a26ffdc7 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Prevent a segfault in GtkPlug

The grabbed_keys might be NULL, so deal with that.
https://bugzilla.gnome.org/show_bug.cgi?id=641023
parent 0208539c
......@@ -665,10 +665,7 @@ gtk_plug_finalize (GObject *object)
GtkPlugPrivate *priv = plug->priv;
if (priv->grabbed_keys)
{
g_hash_table_destroy (priv->grabbed_keys);
priv->grabbed_keys = NULL;
}
G_OBJECT_CLASS (gtk_plug_parent_class)->finalize (object);
}
......@@ -937,8 +934,9 @@ gtk_plug_filter_func (GdkXEvent *gdk_xevent,
break; /* FIXME: shouldn't this unref the plug? i.e. "goto done;" instead */
}
if (priv->grabbed_keys)
{
g_hash_table_iter_init (&iter, priv->grabbed_keys);
while (g_hash_table_iter_next (&iter, &key, NULL))
{
GrabbedKey *grabbed_key = key;
......@@ -947,6 +945,7 @@ gtk_plug_filter_func (GdkXEvent *gdk_xevent,
grabbed_key->accelerator_key,
grabbed_key->accelerator_mods);
}
}
if (!was_embedded)
g_signal_emit_by_name (plug, "embedded");
......
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