Change EventHandler to store IntrusivePtr<Func>

Also deprecates the LocalHandler() and SetLocalHandler() methods,
replaced with GetFunc() and SetFunc().
This commit is contained in:
Jon Siwek 2020-05-21 01:06:05 -07:00
parent 3b6f60a810
commit fbc7725278
4 changed files with 20 additions and 27 deletions

View file

@ -164,14 +164,14 @@ void ID::SetVal(IntrusivePtr<Val> v, bool arg_weak_ref)
if ( ! handler )
{
handler = new EventHandler(name);
handler->SetLocalHandler(val->AsFunc());
handler->SetFunc(val->AsFuncPtr());
event_registry->Register(handler);
}
else
{
// Otherwise, internally defined events cannot
// have local handler.
handler->SetLocalHandler(val->AsFunc());
handler->SetFunc(val->AsFuncPtr());
}
}
}