summaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c
index f63b8564fb..8486f1a5e9 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5322,7 +5322,8 @@ win_free_popup(win_T *win)
close_buffer(win, win->w_buffer, 0, FALSE, FALSE);
}
# if defined(FEAT_TIMERS)
- if (win->w_popup_timer != NULL)
+ // the timer may have been cleared, making the pointer invalid
+ if (timer_valid(win->w_popup_timer))
stop_timer(win->w_popup_timer);
# endif
vim_free(win->w_frame);