[Openmcl-devel] CCL thinks buffer exist...

R. Matthew Emerson rme at clozure.com
Tue Sep 8 17:12:46 UTC 2009

On Sep 7, 2009, at 3:34 AM, peter wrote:

> At 8:17 AM +0200 09/9/7, Rainer Joswig wrote:
>> Any idea what is going on?
> AFAICT when a buffer window is closed, the window and buffer still  
> exist.

Your diagnosis appears to be correct.  I checked in what I think  
should be a fix.

I remember thinking once before that we weren't releasing the editor  
and listener windows when they were closed, but I somehow convinced  
myself that we actually were.  I must have been mistaken.

One thing I'd like to point out is that listeners have an autorelease  
pool.  This way, you can say stuff like (#/orderedWindows *nsapp*),  
and not have the returned object evaporate out from underneath you.   
There's a top-level command ":rap" which will drain the autorelease  

A potentially confusing side effect of this is that if you do (#/ 
orderedWindows *nsapp*), close a document window, and then do (#/ 
orderedWindows *nsapp*) again, you'll see the closed window still in  
the list.  This is because the window is still retained by the NSArray  
that the first call to #/orderedWindows returned.  If you do :rap, and  
then do the (#/orderedWindows *nsapp*) again, the window should be gone.

> See the difference between
> (pprint (hi::all-buffers))
> (defun list-file-buffer-windows ()
>    (loop with win-arr = (#/orderedWindows ccl::*NSApp*)
>      for i below (#/count win-arr)
>      for win = (#/objectAtIndex: win-arr i)
>      when (typep win 'gui::hemlock-frame)
>      collect (hi:hemlock-view-buffer (gui::hemlock-view win))))
> (pprint (list-file-buffer-windows))
> Make a new buffer and delete it, repeat listings.
> Could this be related to your issue Rainer? (i.e. Listener-2 does
> already exist, even if closed ... etc).
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel

More information about the Openmcl-devel mailing list