Allow specifying a filter for Javascript message handlers.

Mask message handlers early enough to avoid trace file races at shutdown.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5443 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2013-04-12 12:53:10 +00:00
parent e08e529ecf
commit d6476113c5
1 changed files with 5 additions and 1 deletions

View File

@ -811,6 +811,10 @@ bool JsMessage::runNative(ObjList& stack, const ExpOperation& oper, GenObject* c
return false;
}
JsHandler* h = new JsHandler(*name,priority,*func,context);
ExpOperation* filterName = static_cast<ExpOperation*>(args[3]);
ExpOperation* filterValue = static_cast<ExpOperation*>(args[4]);
if (filterName && filterValue && *filterName)
h->setFilter(*filterName,*filterValue);
m_handlers.append(h);
Engine::install(h);
}
@ -2231,8 +2235,8 @@ bool JsModule::received(Message& msg, int id)
}
break;
case Halt:
JsGlobal::unloadAll();
s_engineStop = true;
JsGlobal::unloadAll();
return false;
} // switch (id)
return ChanAssistList::received(msg,id);