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

[sc-dev] bug: setProperty on View after window closed



w = SCWindow("my name is... panel", Rect(128, 64, 340, 360));
b = SCSlider(w, Rect(rrand(20,300),rrand(20,300), 75, 24));
w.front;

b.setProperty(\value,0.3);

w.close;

// crash...
b.setProperty(\value,0.5);


Date/Time:  2002-11-21 17:25:20 -0500
OS Version: 10.2.2 (Build 6F21)
Host:       cruxbox.local.

Command:    SuperCollider
PID:        818

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x0000005f

Thread 0 Crashed:
 #0   0x9068ba50 in objc_msgSend
 #1   0x00011b8c in damageFunc(SCRect, void*) (SCGraphView.M:141)
 #2   0x00019be8 in SCTopView::addDamage(SCRect) (SCView.M:841)
 #3   0x000174a0 in SCView::refresh() (SCView.M:447)
 #4   0x0001a660 in SCSlider::setValue(double, bool) (SCView.M:936)
#5 0x0001aaa8 in SCSlider::setProperty(PyrSymbol*, pyrslot*) (SCView.M:993) #6 0x00021698 in prSCView_SetProperty(VMGlobals*, int) (SCView.M:2020) #7 0x0007a448 in doPrimitive(VMGlobals*, PyrMethod*, int) (PyrPrimitive.cpp:3431)
 #8   0x000471f0 in Interpret(VMGlobals*) (PyrInterpreter3.cpp:1854)
 #9   0x00040b30 in runInterpreter (PyrInterpreter3.cpp:113)
#10 0x000175b4 in SCView::sendMessage(PyrSymbol*, int, pyrslot*, pyrslot*) (SCView.M:464)
 #11  0x0001a68c in SCSlider::setValue(double, bool) (SCView.M:938)
 #12  0x0001a7b0 in SCSlider::setValueFromPoint(SCPoint) (SCView.M:955)
 #13  0x0001aa1c in SCSlider::mouseTrack(SCPoint, int) (SCView.M:983)
 #14  0x000163f8 in SCView::mouseBeginTrack(SCPoint, int) (SCView.M:265)
 #15  0x00011898 in -[SCGraphView mouseDown:] (SCGraphView.M:96)
 #16  0x9336dfd4 in -[NSWindow sendEvent:]
 #17  0x930ce328 in -[NSApplication sendEvent:]
 #18  0x930ca524 in -[NSApplication run]
 #19  0x930d2598 in NSApplicationMain
 #20  0x0000d1d4 in main (main.m:5)
 #21  0x00004860 in _start (crt.c:267)
 #22  0x000046e0 in start


trying to fix it...

 the SCView primitive:

 int prSCView_SetProperty(struct VMGlobals *g, int numArgsPushed)
{

...	
	SCView *view = (SCView*)args[0].uo->slots[0].ui;
	if (!view) return errFailed;
...
}

what variable should be invalidated on the SCViews when the window closes ?

SCGraphView

 - (void)closeWindow
{
    delete mTopView;
	mTopView = 0;
	[[self window] close];
}

should it go down the chain from mTopView ?





-felix