Change handlers sometimes stop getting called

Supporting 10.7 and up
musanim
Phidgetsian
Posts: 5
Joined: Tue Jul 03, 2012 11:58 am
Contact:

Change handlers sometimes stop getting called

Postby musanim » Tue Jul 03, 2012 9:56 pm

I have a MacOSX program with various actions the user can initiate from the GUI.
One of these actions initializes the Phidgets device (INIT); I do this action first.
Immediately after doing that, the Input and Position change handlers get called correctly.
However, after that, some sequences of user input cause the handlers to stop getting called.
The strange thing is: it's not that any particular action causes this problem.
For example, these sequences of actions all work fine ...

INIT
INIT A
INIT A B
INIT A B C
INIT A C

... but these sequences do not ...

INIT B
INIT C

Since the only action which calls the Phidgets driver is the INIT (actions A, B and C do not call Phidgets code), I don't know where to look for possible causes of the problem.

Are there any actions that are known to interfere with the correct operation of the Phidgets driver?

musanim
Phidgetsian
Posts: 5
Joined: Tue Jul 03, 2012 11:58 am
Contact:

Re: Change handlers sometimes stop getting called

Postby musanim » Tue Jul 03, 2012 10:42 pm

FOLLOW-UP: I've found that the change handlers sometimes start getting called again.
When this happens, the DetachHandler and then the AttachHandler are called.
What are the reasons that might happen?

musanim
Phidgetsian
Posts: 5
Joined: Tue Jul 03, 2012 11:58 am
Contact:

Re: Change handlers sometimes stop getting called

Postby musanim » Wed Jul 04, 2012 12:21 pm

FOLLOW-UP #2: I've found a very simple failing case which appears to be the same as failure I'm seeing in my application.

In the sample program (Phidgets_Encoder.xcodeproj), if I replace this ...

getchar();

... with this ...

for(;;)
{
getchar();
printf("Got a char ...\n");
}

... then when I set a breakpoint, getchar() returns, it prints the line, and the state change handlers stop working.


Return to “macOS”

Who is online

Users browsing this forum: No registered users and 1 guest