]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fkill_buffer): gcpro BUF during kill_buffer_processes
authorKim F. Storm <storm@cua.dk>
Fri, 13 Apr 2007 12:52:00 +0000 (12:52 +0000)
committerKim F. Storm <storm@cua.dk>
Fri, 13 Apr 2007 12:52:00 +0000 (12:52 +0000)
and check that buffer is still alive upon return.

src/buffer.c

index 3ad92331e01cce0400130ccdf48a7624b9f93782..ba23cc6ae3317f9afacb329e675bf408ca914091 100644 (file)
@@ -1458,7 +1458,16 @@ with SIGHUP.  */)
   unlock_buffer (b);
 #endif /* CLASH_DETECTION */
 
+  GCPRO1 (buf);
   kill_buffer_processes (buf);
+  UNGCPRO;
+
+  /* Killing buffer processes may run sentinels which may
+     have called kill-buffer.  */
+
+  if (NILP (b->name))
+    return Qnil;
+
   clear_charpos_cache (b);
 
   tem = Vinhibit_quit;