Skip navigation.
The QNX Community Portal

View topic - PtRemoveEventHandler() crashes the system

PtRemoveEventHandler() crashes the system

Isn't the name clear?

PtRemoveEventHandler() crashes the system

Postby rahil » Wed Mar 24, 2010 7:21 am

Hi All,

I have created a transparent region, which is forced front and is sensitive to a specific Key event (Ph_EV_KEY). The widget has no parent, and had an event handler (by using PtAddEventHandler).

Now, my region is good enough to call my event handler (myEventHandler) on the desired specific call event. But, I wanted to disable my event handler for the time, it is still running.
To elaborate, my event handler displays a dialog window and I don't want another dialog, when I press the desired keys, while a dialog window is still open.

I know I can track this using some tracking mechanism in the dialog that I open, but alternatively,
I tried to call PtRemoveEventHandler() at the start of the myEventHandler and PtAddEventHandler() at the end of it. But when the key events occur, the system crashes/hangs. Nothing happens and I'm forced to restart the computer.

I pass on the PtWidget_t* & the pointer of/to the myEventHandler to PtRemoveEventHandler() & PtAddEventHandler().
Does anybody know the reason why this is happenning?
Active Member
Posts: 75
Joined: Wed Feb 11, 2009 12:13 pm
Location: India

RE: PtRemoveEventHandler() crashes the system

Postby maschoen » Wed Mar 24, 2010 3:40 pm

There's no obvious reason way. Are you sure that the OS is crashing? This is rare. More likely your code goes into a loop and locks you out.

What I would do is try to create a minimalist version of the application that demonstrates the problem. This has a number of benefits. It tends to narrow down where the problem is. It often reveals the problem. If it makes it easy to show people what the problem is. If all else fails, and you think it might be a bug, sending an easy to understand problem to QNX will get much faster attention than a large and vague one.
QNX Master
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Return to GUI Programming

Who is online

Users browsing this forum: Google [Bot] and 2 guests