forked from AuroraMiddleware/gtk
gdk: Avoid poking possibly freed memory
The event may end up freed after delivery, ensure to keep a ref in order to emit the matching emulated crossed event matching a proximity event. Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2157
This commit is contained in:
parent
f354a7787a
commit
075c77325b
@ -3327,6 +3327,8 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
|
||||
if (!event)
|
||||
return;
|
||||
|
||||
g_object_ref (event);
|
||||
|
||||
switch ((guint) event->any.type)
|
||||
{
|
||||
case GDK_MOTION_NOTIFY:
|
||||
@ -3367,6 +3369,8 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
|
||||
emulate_crossing (event->any.surface, NULL,
|
||||
tablet->master, GDK_ENTER_NOTIFY,
|
||||
GDK_CROSSING_NORMAL, time);
|
||||
|
||||
g_object_unref (event);
|
||||
}
|
||||
|
||||
static GdkEvent *
|
||||
|
Loading…
Reference in New Issue
Block a user