]> code.delx.au - gnu-emacs/commitdiff
winner no longer holds on to dead frames
authorDima Kogan <dima@secretsauce.net>
Tue, 15 Sep 2015 18:53:54 +0000 (11:53 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 16 Sep 2015 16:27:51 +0000 (09:27 -0700)
* lisp/winner.el (winner-change-fun): Cull dead frames.
This prevents a potentially massive memory leak.  See:
http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00619.html

lisp/winner.el

index fdf62137514fc47071a094ff649d5c6b39c0314f..a05f4ba867eaf457430d8536bd534ca3b3142d86 100644 (file)
@@ -177,6 +177,11 @@ You may want to include buffer names such as *Help*, *Apropos*,
 ;; Called whenever the window configuration changes
 ;; (a `window-configuration-change-hook').
 (defun winner-change-fun ()
+
+  ;; Cull dead frames.
+  (setq winner-modified-list
+        (cl-remove-if-not 'frame-live-p winner-modified-list))
+
   (unless (or (memq (selected-frame) winner-modified-list)
               (/= 0 (minibuffer-depth)))
     (push (selected-frame) winner-modified-list)))