fix #9225 events with negative priority getting erroneously deleted
previously is_map_[id] would point to the wrong event, so that when an event was later deleted by id the wrong event would be deleted.
This commit is contained in:
parent
4927e71ed1
commit
c15df9d3f5
1 changed files with 1 additions and 1 deletions
|
@ -144,7 +144,6 @@ void event_handlers::finish_adding_event_handler(handler_ptr handler)
|
|||
// construct weak_ptrs from the shared one.
|
||||
DBG_EH << "inserting event handler for name=" << names << " with id=" << id;
|
||||
active_.emplace_back(handler);
|
||||
std::stable_sort(active_.rbegin(), active_.rend(), cmp);
|
||||
|
||||
// File by name.
|
||||
if(utils::might_contain_variables(names)) {
|
||||
|
@ -160,6 +159,7 @@ void event_handlers::finish_adding_event_handler(handler_ptr handler)
|
|||
id_map_[id] = active_.back();
|
||||
}
|
||||
|
||||
std::stable_sort(active_.rbegin(), active_.rend(), cmp);
|
||||
log_handlers();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue