summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-10-12 11:41:47 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-10-12 11:41:47 (GMT)
commit4d186e24e44fe07f04708c2dc38387534c02c7fd (patch)
tree0eb180d11919b63e09af31e9af06d7c1d0f027e9 /apps
parentcc0d3d3f832cf643f55eb452df7b62c18a092731 (diff)
downloaduscxml-4d186e24e44fe07f04708c2dc38387534c02c7fd.zip
uscxml-4d186e24e44fe07f04708c2dc38387534c02c7fd.tar.gz
uscxml-4d186e24e44fe07f04708c2dc38387534c02c7fd.tar.bz2
Stop browser when last document ends
Diffstat (limited to 'apps')
-rw-r--r--apps/uscxml-browser.cpp9
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++;
+ }
}
}