Change Input::update_finished lookup to happen at init time.

Also going through the internal_handler() function will set the
event as "used" (i.e. it's marked as being raised somewhere) and
fixes the core.check-unused-event-handlers test failure
(addresses #823).
This commit is contained in:
Jon Siwek 2012-05-31 15:32:28 -05:00
parent 60875adfc5
commit eeb1609768
2 changed files with 4 additions and 5 deletions

View file

@ -194,6 +194,7 @@ Manager::TableStream::~TableStream()
Manager::Manager()
{
update_finished = internal_handler("Input::update_finished");
}
Manager::~Manager()
@ -1199,11 +1200,7 @@ void Manager::EndCurrentSend(ReaderFrontend* reader)
#endif
// Send event that the current update is indeed finished.
EventHandler* handler = event_registry->Lookup("Input::update_finished");
if ( handler == 0 )
reporter->InternalError("Input::update_finished not found!");
SendEvent(handler, 2, new StringVal(i->name.c_str()), new StringVal(i->source.c_str()));
SendEvent(update_finished, 2, new StringVal(i->name.c_str()), new StringVal(i->source.c_str()));
}
void Manager::Put(ReaderFrontend* reader, Value* *vals)