From: Benjamin Otte Date: Sat, 4 Nov 2017 00:35:59 +0000 (+0100) Subject: x11: Don't use g_hash_table_steal() X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~23^2~894 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d78bbb7e96efcbc83a8bc0ea71f62797c7a8432d;p=gtk4.git x11: Don't use g_hash_table_steal() It returns TRUE/FALSE, not the item you've stolen, so if you free that, your X connections is gonna have a BadCursor. --- diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index ec9db4a8a7..d7069f450f 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -49,8 +49,9 @@ gdk_x11_cursor_remove_from_cache (gpointer data, GObject *cursor) GdkDisplay *display = data; Cursor xcursor; - xcursor = GDK_POINTER_TO_XID (g_hash_table_steal (GDK_X11_DISPLAY (display)->cursors, cursor)); + xcursor = GDK_POINTER_TO_XID (g_hash_table_lookup (GDK_X11_DISPLAY (display)->cursors, cursor)); XFreeCursor (GDK_DISPLAY_XDISPLAY (display), xcursor); + g_hash_table_remove (GDK_X11_DISPLAY (display)->cursors, cursor); } void