Home › Forums › OpenEars › pocketSphinx continuous recognition loop has failed › Reply To: pocketSphinx continuous recognition loop has failed
Because I ran into the issue above I am trying to nil the controller when the user toggles the button to off/stop
You definitely can’t nil the controller unless you’ve received a callback that listening has stopped – when it works otherwise it’s coincidental, due to lucky timing with the threads being released and your assignment of nil. You can nil it if the user sets it to off and then you get a callback. In the meantime before the callback you have to block further interaction with the on/off button or you will end up with unreachable threads with events in them that can lead to a bad termination, again except in lucky cases.
The design is to have a single instance that works robustly, not to destroy and create instances over a session, so the effort should just go into the robustness for the single instance. It sounds like you found a case in which the normal chain of events doesn’t fire – I appreciate it and I’ll take a look at the case you found in a bit, thanks.