diff options
Diffstat (limited to 'src/uscxml/interpreter/InterpreterMonitor.h')
-rw-r--r-- | src/uscxml/interpreter/InterpreterMonitor.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/uscxml/interpreter/InterpreterMonitor.h b/src/uscxml/interpreter/InterpreterMonitor.h index 27222b4..70cac0c 100644 --- a/src/uscxml/interpreter/InterpreterMonitor.h +++ b/src/uscxml/interpreter/InterpreterMonitor.h @@ -34,16 +34,19 @@ catch (...) { LOG(USCXML_ERROR) << "An exception occurred when calling " #callba if (_state == USCXML_DESTROYED) { throw std::bad_weak_ptr(); } #define USCXML_MONITOR_CALLBACK(callbacks, function) { \ +if (callbacks.size() > 0) {\ Interpreter inptr = _callbacks->getInterpreter(); \ -for (auto callback : callbacks) { callback->function(inptr); } } +for (auto callback : callbacks) { callback->function(inptr); } } } #define USCXML_MONITOR_CALLBACK1(callbacks, function, arg1) { \ +if (callbacks.size() > 0) {\ Interpreter inptr = _callbacks->getInterpreter(); \ -for (auto callback : callbacks) { callback->function(inptr, arg1); } } +for (auto callback : callbacks) { callback->function(inptr, arg1); } } } #define USCXML_MONITOR_CALLBACK2(callbacks, function, arg1, arg2) { \ +if (callbacks.size() > 0) {\ Interpreter inptr = _callbacks->getInterpreter(); \ -for (auto callback : callbacks) { callback->function(inptr, arg1, arg2); } } +for (auto callback : callbacks) { callback->function(inptr, arg1, arg2); } } } // forward declare namespace XERCESC_NS { |