Fixup 2c12d1328b
(don't try to dereference a nullptr)
This commit is contained in:
parent
f17dcd4195
commit
238a994429
1 changed files with 8 additions and 2 deletions
|
@ -176,8 +176,14 @@ void event_handlers::remove_event_handler(const std::string& id)
|
|||
// Do this even if the lock failed.
|
||||
id_map_.erase(find_it);
|
||||
|
||||
// Remove handler from other lists.
|
||||
clean_up_expired_handlers(handler->get_config()["name"]);
|
||||
// Remove handler from other lists if we got a lock. If we didn't, the handler
|
||||
// was already from the main list previously, so any other weak_ptrs to it in
|
||||
// the by-name or with-vars list should already have been dropped. If for some
|
||||
// reason they haven't, no problem. They don't do anything and will be dropped
|
||||
// next cleanup.
|
||||
if(handler) {
|
||||
clean_up_expired_handlers(handler->get_config()["name"]);
|
||||
}
|
||||
}
|
||||
|
||||
log_handlers();
|
||||
|
|
Loading…
Add table
Reference in a new issue