summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index cbf0ff86b..de85739a0 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2489,6 +2489,10 @@ win_free_all()
while (firstwin != NULL)
(void)win_free_mem(firstwin, &dummy, NULL);
+
+ /* No window should be used after this. Set curwin to NULL to crash
+ * instead of using freed memory. */
+ curwin = NULL;
}
#endif