[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] [commit] minor changes



SCVirtualMachine.M

- (void)windowWillClose:(NSNotification *)aNotification
{
NSWindow* window = [aNotification object];
[self endFullScreen: window];
[guiWindows removeObject: window];


[[window contentView] willClose];
/* this is now handled by the content view itself
to allow for other kinds of content views
SCGraphView* view = (SCGraphView*)[window contentView];


pthread_mutex_lock (&gLangMutex);
struct PyrObject *scobj = [view getSCObject];
if (scobj) {
SetPtr(scobj->slots + 0, self);
VMGlobals *g = gMainVMGlobals;
g->canCallOS = true;
++g->sp; SetObject(g->sp, scobj); // push window obj
runInterpreter(g, s_closed, 1);
g->canCallOS = false;
[view setSCObject: nil];
}
pthread_mutex_unlock (&gLangMutex);


[view willClose];
*/


}

SCGraphView.M

- (void)willClose
{
pthread_mutex_lock (&gLangMutex);
if (mWindowObj) {
SetPtr(mWindowObj->slots + 0, self);
VMGlobals *g = gMainVMGlobals;
g->canCallOS = true;
++g->sp; SetObject(g->sp, mWindowObj); // push window obj
runInterpreter(g, s_closed, 1);
g->canCallOS = false;
mWindowObj = 0;
}
pthread_mutex_unlock (&gLangMutex);


//printf("willClose %08X mTopView %08X\n", self, mTopView);
delete mTopView;
mTopView = 0;

}