Changeset 12786


Ignore:
Timestamp:
Sep 8, 2009, 4:54:52 PM (10 years ago)
Author:
rme
Message:

Remove the specialized #/close method on hemlock-frame (whose main job
was to get rid of the echo area data structures). Do its work in a
new #/windowWillClose: delegate method on
hemlock-editor-window-controller, which also releases the window
object (which we were neglecting to do).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/cocoa-editor.lisp

    r12758 r12786  
    20492049    (when (and pane (not (%null-ptr-p pane)))
    20502050      (report-condition-in-hemlock-frame condition (#/window pane)))))
    2051                        
    2052 (objc:defmethod (#/close :void) ((self hemlock-frame))
    2053   (let* ((content-view (#/contentView self))
    2054          (subviews (#/subviews content-view)))
    2055     (do* ((i (1- (#/count subviews)) (1- i)))
    2056          ((< i 0))
    2057       (#/removeFromSuperviewWithoutNeedingDisplay (#/objectAtIndex: subviews i))))
    2058   (let* ((buf (hemlock-frame-echo-area-buffer self))
    2059          (echo-doc (if buf (hi::buffer-document buf))))
    2060     (when echo-doc
    2061       (setf (hemlock-frame-echo-area-buffer self) nil)
    2062       (#/close echo-doc)))
    2063   (release-canonical-nsobject self)
    2064   (#/setFrameAutosaveName: self #@"")
    2065   (call-next-method))
    20662051
    20672052(defun window-menubar-height ()
     
    23962381            (ns:ns-rect-y r) (ns:ns-rect-y default-frame)))
    23972382    r))
     2383
     2384(objc:defmethod (#/windowWillClose: :void) ((wc hemlock-editor-window-controller)
     2385                                            notification)
     2386  (declare (ignore notification))
     2387  ;; The echo area "document" should probably be a slot in the document
     2388  ;; object, and released when the document object is.
     2389  (let* ((w (#/window wc))
     2390         (buf (hemlock-frame-echo-area-buffer w))
     2391         (echo-doc (if buf (hi::buffer-document buf))))
     2392    (when echo-doc
     2393      (setf (hemlock-frame-echo-area-buffer w) nil)
     2394      (#/close echo-doc))
     2395    (#/setFrameAutosaveName: w #@"")
     2396    (#/autorelease w)))
    23982397
    23992398(defmethod hemlock-view ((self hemlock-editor-window-controller))
Note: See TracChangeset for help on using the changeset viewer.