Tale
11-14-2010, 11:50 PM
My ComboV project crashes AU Lab 2.1 when switching to Generic View. I have also tested Schwa's Olga in AU Lab, and that also crashes.
The cause is that mouseMoved, mouseDown etc. in IGraphicsCocoa.mm are being called while mGraphics is NULL. A solution is to check mGraphics in mouseMoved etc.:
- (void) mouseMoved: (NSEvent*) pEvent
{
if (mGraphics)
{
int x, y;
[self getMouseXY:pEvent x:&x y:&y];
mGraphics->OnMouseOver(x, y, &GetMouseMod(pEvent));
}
}
Now it doesn't crash AU Lab Generic Mode anymore, but the GUI is displayed behind the Generic View. This can be fixed by checking mGraphics in isOpaque:
- (BOOL) isOpaque
{
return mGraphics ? YES : NO;
}
The cause is that mouseMoved, mouseDown etc. in IGraphicsCocoa.mm are being called while mGraphics is NULL. A solution is to check mGraphics in mouseMoved etc.:
- (void) mouseMoved: (NSEvent*) pEvent
{
if (mGraphics)
{
int x, y;
[self getMouseXY:pEvent x:&x y:&y];
mGraphics->OnMouseOver(x, y, &GetMouseMod(pEvent));
}
}
Now it doesn't crash AU Lab Generic Mode anymore, but the GUI is displayed behind the Generic View. This can be fixed by checking mGraphics in isOpaque:
- (BOOL) isOpaque
{
return mGraphics ? YES : NO;
}