summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Radomski <sradomski@mintwerk.de>2016-05-05 11:33:10 (GMT)
committerStefan Radomski <sradomski@mintwerk.de>2016-05-05 11:33:10 (GMT)
commit43ac168a8ea4a75f1df7b2b6d7444b618eedd42c (patch)
tree17df92e5bb5548de5cb5bd952165e4384cca8a53
parent4750623a631e72c7a8be8d4172b33c83f20113a6 (diff)
downloaduscxml-43ac168a8ea4a75f1df7b2b6d7444b618eedd42c.zip
uscxml-43ac168a8ea4a75f1df7b2b6d7444b618eedd42c.tar.gz
uscxml-43ac168a8ea4a75f1df7b2b6d7444b618eedd42c.tar.bz2
Fixed first part of issue 68
-rw-r--r--src/uscxml/Interpreter.cpp4
-rw-r--r--test/src/issues/test-issue68.scxml29
2 files changed, 33 insertions, 0 deletions
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp
index ef7afde..0fa366b 100644
--- a/src/uscxml/Interpreter.cpp
+++ b/src/uscxml/Interpreter.cpp
@@ -2660,6 +2660,10 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Element<std::string>& c
return;
}
_sendQueue->cancelEvent(sendId);
+ {
+ tthread::lock_guard<tthread::recursive_mutex> lock(_sendQueue->_mutex);
+ _sendIds.erase(sendId); // issue 68
+ }
}
CATCH_AND_DISTRIBUTE2("Syntax error while executing cancel element", content)
diff --git a/test/src/issues/test-issue68.scxml b/test/src/issues/test-issue68.scxml
new file mode 100644
index 0000000..cd99bc0
--- /dev/null
+++ b/test/src/issues/test-issue68.scxml
@@ -0,0 +1,29 @@
+<scxml datamodel="lua" initial="work" name="root" version="1.0" xmlns="http://www.w3.org/2005/07/scxml">
+ <datamodel>
+ <data expr="0" id="testvar1"/>
+ </datamodel>
+ <state id="work" initial="act1">
+ <transition event="OnTimer" target="fail"/>
+ <transition cond="testvar1&gt;3" target="pass"/>
+ <state id="act1">
+ <onentry>
+ <send delay="3000ms" event="OnTimer" id="ID_OnTimer"/>
+ <send delay="300ms" event="OnDone"/>
+ <assign expr="testvar1 + 1" location="testvar1"/>
+ <log expr="testvar1" />
+ </onentry>
+ <onexit>
+ <cancel sendid="ID_OnTimer"/>
+ </onexit>
+ <transition event="OnDone" target="act2"/>
+ </state>
+ <state id="act2">
+ <onentry>
+ <send delay="1000ms" event="Back"/>
+ </onentry>
+ <transition event="Back" target="act1"/>
+ </state>
+ </state>
+ <final id="fail"/>
+ <final id="pass"/>
+</scxml>