Hi,

The strangest of bugs has crossed my path. I'm writing a desk accessory, and I was getting a 'Privilege Violation' *after* my desk accessory *and* the running application quit. After commenting code to isolate the problem, I concluded it was caused by a static variable inside a static function. The smallest code snippet that caused an error was like this:

static void handleEvent(EventPtr event)
{
    static ControlPtr penDownCtl;
    penDownCtl = NULL;
}

If I remove the static qualifier or the assignment, there's no error.

Can anyone explain this? It's just for curiosity. I have already solved the problem without a static var.

--
Sergio Carvalho
---------------
[EMAIL PROTECTED]

If at first you don't succeed, skydiving is not for you
 

Reply via email to