diff options
author | Matthias Clasen <mclasen@redhat.com> | 2011-04-08 21:20:26 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2011-04-08 21:20:26 -0400 |
commit | 9e6d3d969cd314093e161a3c1feba1612ed403bc (patch) | |
tree | a43e47bc10887803f01547903d6127feae3da6b3 /gdk/gdkevents.c | |
parent | 32358a58f4a5da12a5b04faad7c02b634079d7b2 (diff) | |
download | gtk+-9e6d3d969cd314093e161a3c1feba1612ed403bc.tar.gz |
Fix some possible crashes if the default display is NULL
Unlikely that many people will hit these, but still.
https://bugzilla.gnome.org/show_bug.cgi?id=645176
Diffstat (limited to 'gdk/gdkevents.c')
-rw-r--r-- | gdk/gdkevents.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 25853da3af..29dff076d0 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -605,6 +605,8 @@ gdk_event_copy (const GdkEvent *event) void gdk_event_free (GdkEvent *event) { + GdkDisplay *display; + g_return_if_fail (event != NULL); if (event->any.window) @@ -670,7 +672,9 @@ gdk_event_free (GdkEvent *event) break; } - _gdk_display_event_data_free (gdk_display_get_default (), event); + display = gdk_display_get_default (); + if (display) + _gdk_display_event_data_free (display, event); g_hash_table_remove (event_hash, event); g_slice_free (GdkEventPrivate, (GdkEventPrivate*) event); |