From: Thomas Geymayer Date: Sun, 10 Aug 2014 22:31:18 +0000 (+0200) Subject: Nasal Timer: prevent warning on restarting oneshot timer in callback. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=67138302543a4e64f897bdfe7bc996d099360c28;p=flightgear.git Nasal Timer: prevent warning on restarting oneshot timer in callback. --- diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index f70aa3c61..75c49fbcf 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -146,11 +146,14 @@ public: void invoke() { + if( _singleShot ) + // Callback may restart the timer, so update status before callback is + // called (Prevent warnings of deleting not existing tasks from the + // event manager). + _isRunning = false; + naRef *args = NULL; _sys->callMethod(_func, _self, 0, args, naNil() /* locals */); - if (_singleShot) { - _isRunning = false; - } } void setSingleShot(bool aSingleShot)