updated for version 7.2b-000
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 83cffc1..246c4c0 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -6728,6 +6728,10 @@
     if (curbuf_locked())
 	return;
 #endif
+    /* When the screen is being updated we should not change buffers and
+     * windows structures, it may cause freed memory to be used. */
+    if (updating_screen)
+	return;
 
     /* Check whether the current buffer is changed. If so, we will need
      * to split the current window or data could be lost.