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)
*/
static naRef f_parse_markdown(naContext c, naRef me, int argc, naRef* args)
{
- nasal::CallContext ctx(c, argc, args);
+ nasal::CallContext ctx(c, me, argc, args);
return ctx.to_nasal(
simgear::SimpleMarkdown::parse(ctx.requireArg<std::string>(0))
);