You and several of us have seen this; read the discussion here -> http://forums.adobe.com/message/4043881#4043881
* a related issue to switching mics too many times that caused that error is also here -> http://forums.adobe.com/message/4122004#4122004
For my problem, I ended up switching from
Offending code: Microphone.getMicrophone( micIndex ); // mixIndex is most likely irrelevant here
In your case you'd probably need to change when you stop the publishing in your code maybe....