Prevent a segfault in GtkPlug
The grabbed_keys might be NULL, so deal with that. https://bugzilla.gnome.org/show_bug.cgi?id=641023
This commit is contained in:
@ -665,10 +665,7 @@ gtk_plug_finalize (GObject *object)
|
|||||||
GtkPlugPrivate *priv = plug->priv;
|
GtkPlugPrivate *priv = plug->priv;
|
||||||
|
|
||||||
if (priv->grabbed_keys)
|
if (priv->grabbed_keys)
|
||||||
{
|
|
||||||
g_hash_table_destroy (priv->grabbed_keys);
|
g_hash_table_destroy (priv->grabbed_keys);
|
||||||
priv->grabbed_keys = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (gtk_plug_parent_class)->finalize (object);
|
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 */
|
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);
|
g_hash_table_iter_init (&iter, priv->grabbed_keys);
|
||||||
|
|
||||||
while (g_hash_table_iter_next (&iter, &key, NULL))
|
while (g_hash_table_iter_next (&iter, &key, NULL))
|
||||||
{
|
{
|
||||||
GrabbedKey *grabbed_key = key;
|
GrabbedKey *grabbed_key = key;
|
||||||
@ -947,6 +945,7 @@ gtk_plug_filter_func (GdkXEvent *gdk_xevent,
|
|||||||
grabbed_key->accelerator_key,
|
grabbed_key->accelerator_key,
|
||||||
grabbed_key->accelerator_mods);
|
grabbed_key->accelerator_mods);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!was_embedded)
|
if (!was_embedded)
|
||||||
g_signal_emit_by_name (plug, "embedded");
|
g_signal_emit_by_name (plug, "embedded");
|
||||||
|
|||||||
Reference in New Issue
Block a user