From 42052686752e399e778d33401dd621afbac0071d Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 26 May 2023 08:43:18 +0800 Subject: [PATCH] Don't mark selection request events * src/pgtkterm.c (mark_pgtkterm): Prevent crash by not marking selection request events, which don't have Lisp_Object members. --- src/pgtkterm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pgtkterm.c b/src/pgtkterm.c index c00e13550bd..f4b05ef9903 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -376,6 +376,13 @@ mark_pgtkterm (void) for (i = 0; i < n; i++) { union buffered_input_event *ev = &evq->q[i]; + + /* Selection requests don't have Lisp object members. */ + + if (ev->ie.kind == SELECTION_REQUEST_EVENT + || ev->ie.kind == SELECTION_CLEAR_EVENT) + continue; + mark_object (ev->ie.x); mark_object (ev->ie.y); mark_object (ev->ie.frame_or_window); -- 2.39.2