Fix an ordering issue in event destruction

gdk_event_get_display accesses event->any.window, so don't
free that window first thing.
This commit is contained in:
Matthias Clasen 2014-11-01 14:44:03 -04:00
parent 18a2a6a90e
commit 1a3bdefb00

View File

@ -740,9 +740,6 @@ gdk_event_free (GdkEvent *event)
g_return_if_fail (event != NULL);
if (event->any.window)
g_object_unref (event->any.window);
switch (event->any.type)
{
case GDK_KEY_PRESS:
@ -814,6 +811,9 @@ gdk_event_free (GdkEvent *event)
if (display)
_gdk_display_event_data_free (display, event);
if (event->any.window)
g_object_unref (event->any.window);
g_hash_table_remove (event_hash, event);
g_slice_free (GdkEventPrivate, (GdkEventPrivate*) event);
}