[sc-users] gui crashes

Julian Rohrhuber rohrhuber at uni-hamburg.de
Sun Jul 2 16:30:36 PDT 2006


At 3:47 Uhr -0700 02.07.2006, James McCartney wrote:


OK the reason this happens is that I fixed a bug where SCGraphViews 
were being leaked because [super dealloc] was not being called, and 
this revealed a bug introduced by jrhb when he moved the 
onClose.value to the top of SCWindow-closed. Why was this done? I can 
find no reason given in the mailing list around the date of the 
check-in. I assume perhaps so that the user has access to the dataptr?


actually I can't remember why I have done this, maybe a request by 
someone earlier. I don't see a reason for this myself now - maybe to 
be able to access the view before it is closed itself?



Revision 
<http://svn.sourceforge.net/viewcvs.cgi/supercollider?rev=4421&sortby=date&view=rev>4421 
- 
(<http://svn.sourceforge.net/viewcvs.cgi/supercollider/trunk/build/SCClassLibrary/Common/GUI/Base/GUIScreen.sc?view=markup&rev=4421&sortby=date>view) 
(<http://svn.sourceforge.net/viewcvs.cgi/*checkout*/supercollider/trunk/build/SCClassLibrary/Common/GUI/Base/GUIScreen.sc?rev=4421>download) 
(<http://svn.sourceforge.net/viewcvs.cgi/supercollider/trunk/build/SCClassLibrary/Common/GUI/Base/GUIScreen.sc?annotate=4421&sortby=date>annotate) 
- 
<http://svn.sourceforge.net/viewcvs.cgi/supercollider/trunk/build/SCClassLibrary/Common/GUI/Base/GUIScreen.sc?sortby=date&r1=4421&view=log>[select 
for diffs]
Modified Tue Apr 5 14:38:45 2005 UTC (14 months, 3 weeks ago) by jrhb
File length: 3257 byte(s)
Diff to 
<http://svn.sourceforge.net/viewcvs.cgi/supercollider/trunk/build/SCClassLibrary/Common/GUI/Base/GUIScreen.sc?r1=4366&r2=4421&sortby=date>previous 
4366
call onClose first.


What happens is the the class browser gets a 'closed' method, it 
calls onClose, that calls 'free' on the browser and that tests to see 
if the window is closed and if not, it closes the window.  The 
problem is that by moving onClose.value before dataptr is set to nil, 
the test to see if the window is closed returns false and so the view 
is sent the close message after it is already dealloced.

Anyway, I think I've fixed it by adding an isClosed flag instance 
variable and not relying on dataptr to indicate whether the window is 
closed.

This had nothing to do with the UDP packet size limit change.


-- 





.


More information about the sc-users mailing list