aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2021-11-14 09:58:21 +0800
committerPo Lu2021-11-14 10:00:40 +0800
commit9627b731c0611fd14850edd2e045f2c606fc151e (patch)
tree99f3d1ebb7fc9b6181fc27c19d7517c67d9d0094 /src
parente29c9308b14893622c257a1c106ec734e2e70dc7 (diff)
downloademacs-9627b731c0611fd14850edd2e045f2c606fc151e.tar.gz
emacs-9627b731c0611fd14850edd2e045f2c606fc151e.zip
Fix crash in xwidget_end_redisplay
* src/xwidget.c (xwidget_end_redisplay): Always test if xv is NULL.
Diffstat (limited to 'src')
-rw-r--r--src/xwidget.c17
1 files changed, 7 insertions, 10 deletions
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)
2643 xwidget_end_redisplay (w->current_matrix); */ 2643 xwidget_end_redisplay (w->current_matrix); */
2644 struct xwidget_view *xv 2644 struct xwidget_view *xv
2645 = xwidget_view_lookup (xwidget_from_id (glyph->u.xwidget), w); 2645 = xwidget_view_lookup (xwidget_from_id (glyph->u.xwidget), w);
2646#ifdef USE_GTK 2646
2647 /* FIXME: Is it safe to assume xwidget_view_lookup 2647 /* In NS xwidget, xv can be NULL for the second or
2648 always succeeds here? If so, this comment can be removed.
2649 If not, the code probably needs fixing. */
2650 eassume (xv);
2651 xwidget_touch (xv);
2652#elif defined NS_IMPL_COCOA
2653 /* In NS xwidget, xv can be NULL for the second or
2654 later views for a model, the result of 1 to 1 2648 later views for a model, the result of 1 to 1
2655 model view relation enforcement. */ 2649 model view relation enforcement. `xwidget_view_lookup'
2650 has also been observed to return NULL here on X-Windows
2651 at least once, so stay safe and only touch it if it's
2652 not NULL. */
2653
2656 if (xv) 2654 if (xv)
2657 xwidget_touch (xv); 2655 xwidget_touch (xv);
2658#endif
2659 } 2656 }
2660 } 2657 }
2661 } 2658 }