/[climacs]/climacs/core.lisp
ViewVC logotype

Diff of /climacs/core.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by thenriksen, Wed Dec 12 23:44:42 2007 UTC revision 1.19 by thenriksen, Thu Dec 13 19:09:39 2007 UTC
# Line 87  since it was last saved)." Line 87  since it was last saved)."
87         (filepath (buffer view))         (filepath (buffer view))
88         (needs-saving (buffer view))))         (needs-saving (buffer view))))
89    
90    (defun dummy-buffer ()
91      "Create a dummy buffer object for use when killing views, to
92    prevent increasing memory usage."
93      (make-instance 'drei-buffer))
94    
95  (defgeneric kill-view (view)  (defgeneric kill-view (view)
96    (:documentation "Remove `view' from the Climacs specified in    (:documentation "Remove `view' from the Climacs specified in
97  `*esa-instance*'. If `view' is currently displayed in a window,  `*esa-instance*'. If `view' is currently displayed in a window,
# Line 106  it will be replaced by some other view." Line 111  it will be replaced by some other view."
111                                    (return-from kill-view nil)))))                                    (return-from kill-view nil)))))
112        (save-buffer (buffer view)))        (save-buffer (buffer view)))
113      (setf views (remove view views))      (setf views (remove view views))
114        ;; If we don't change the buffer of the view, a reference to the
115        ;; view will be kept in the buffer, and the view will thus not be
116        ;; garbage-collected. So create a circular reference structure
117        ;; that can be garbage-collected instead.
118        (setf (buffer view) (dummy-buffer))
119      (full-redisplay (current-window))      (full-redisplay (current-window))
120      (current-view)))      (current-view)))
121    

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.5