summaryrefslogtreecommitdiff
path: root/atspi/atspi-device-x11.c
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2023-05-17 16:18:51 -0500
committerMike Gorse <mgorse@suse.com>2023-05-17 16:22:27 -0500
commit37e7d3c77c5175aed382c498bffb876ea0c8581b (patch)
treeaaa62d5538bdf664390673ec6d2641f8f75a0664 /atspi/atspi-device-x11.c
parent1c4de77eaef8ad644e8a6a8a2e251c84017be324 (diff)
downloadat-spi2-core-main.tar.gz
Hold a reference to the AtspiDevice while processing eventsHEADmain
If this is not done, then the device might be finalized from under us during a callback, leading to a crash.
Diffstat (limited to 'atspi/atspi-device-x11.c')
-rw-r--r--atspi/atspi-device-x11.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/atspi/atspi-device-x11.c b/atspi/atspi-device-x11.c
index 16fb1636..1c0bee89 100644
--- a/atspi/atspi-device-x11.c
+++ b/atspi/atspi-device-x11.c
@@ -330,6 +330,7 @@ do_event_dispatch (gpointer user_data)
XComposeStatus status;
guint modifiers;
+ g_object_ref (device);
while (XPending (display))
{
XNextEvent (display, &xevent);
@@ -392,6 +393,8 @@ do_event_dispatch (gpointer user_data)
continue;
}
}
+
+ g_object_unref (device);
return TRUE;
}