From 94e118536986207ae17535c3d130b4172e408b7c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 14 Jun 2022 22:13:49 +0300 Subject: [PATCH] Support callers which sometimes run unrelated to display code * src/xdisp.c (update_redisplay_ticks): Don't abort callers with w == NULL if we are called outside of display engine code, and don't update the tick count in that case. --- src/xdisp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index d14955af415..1ba9132e8c0 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -17199,6 +17199,11 @@ update_redisplay_ticks (int ticks, struct window *w) cwindow = w; window_ticks = 0; } + /* Some callers can be run in contexts unrelated to redisplay, so + don't abort them and don't update the tick count in those cases. */ + if (!w && !redisplaying_p) + return; + if (ticks > 0) window_ticks += ticks; if (max_redisplay_ticks > 0 && window_ticks > max_redisplay_ticks) -- 2.39.2