[gtk/gtk-3-24: 17/20] Fix crash if there are no grabs in place.
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24: 17/20] Fix crash if there are no grabs in place.
- Date: Sat, 8 Dec 2018 19:44:03 +0000 (UTC)
commit 5294c4f6f33c8071d9c948752c4e3bd728746890
Author: John Ralls <jralls ceridwen us>
Date: Mon Nov 26 09:51:36 2018 +0900
Fix crash if there are no grabs in place.
gdk/gdkdisplay.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 40225e92ac..1845e80de3 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -1318,6 +1318,11 @@ _gdk_display_check_grab_ownership (GdkDisplay *display,
GdkGrabOwnership higher_ownership, device_ownership;
gboolean device_is_keyboard;
+ g_return_val_if_fail (display, TRUE);
+
+ if (!display->device_grabs)
+ return TRUE; /* No hash table, no grabs. */
+
g_hash_table_iter_init (&iter, display->device_grabs);
higher_ownership = device_ownership = GDK_OWNERSHIP_NONE;
device_is_keyboard = (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]