diff options
-rw-r--r-- | apps/uscxml-browser.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/uscxml-browser.cpp b/apps/uscxml-browser.cpp index 566f6bc..e6869c4 100644 --- a/apps/uscxml-browser.cpp +++ b/apps/uscxml-browser.cpp @@ -179,12 +179,17 @@ int main(int argc, char** argv) { interpreterIter++; } + bool stillRunning = true; // call from main thread for UI events while(interpreters.size() > 0) { interpreterIter = interpreters.begin(); while(interpreterIter != interpreters.end()) { - interpreterIter->runOnMainThread(25); - interpreterIter++; + stillRunning = interpreterIter->runOnMainThread(25); + if (stillRunning) { + interpreters.erase(interpreterIter++); + } else { + interpreterIter++; + } } } |