From: Po Lu Date: Sun, 14 Nov 2021 01:58:21 +0000 (+0800) Subject: Fix crash in xwidget_end_redisplay X-Git-Tag: emacs-29.0.90~2852^2~297 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9627b731c0611fd14850edd2e045f2c606fc151e;p=emacs.git Fix crash in xwidget_end_redisplay * src/xwidget.c (xwidget_end_redisplay): Always test if xv is NULL. --- diff --git a/src/xwidget.c b/src/xwidget.c index ca0392a44d6..609a231d4bb 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -2643,19 +2643,16 @@ xwidget_end_redisplay (struct window *w, struct glyph_matrix *matrix) xwidget_end_redisplay (w->current_matrix); */ struct xwidget_view *xv = xwidget_view_lookup (xwidget_from_id (glyph->u.xwidget), w); -#ifdef USE_GTK - /* FIXME: Is it safe to assume xwidget_view_lookup - always succeeds here? If so, this comment can be removed. - If not, the code probably needs fixing. */ - eassume (xv); - xwidget_touch (xv); -#elif defined NS_IMPL_COCOA - /* In NS xwidget, xv can be NULL for the second or + + /* In NS xwidget, xv can be NULL for the second or later views for a model, the result of 1 to 1 - model view relation enforcement. */ + model view relation enforcement. `xwidget_view_lookup' + has also been observed to return NULL here on X-Windows + at least once, so stay safe and only touch it if it's + not NULL. */ + if (xv) xwidget_touch (xv); -#endif } } }