FIX: subscribing when manager is unset
One feature added to EventManager has been disconnecting a participant at runtime. Unfortunatly, then the manager of this participant is set to nullptr using the setManager method. But this method also subscribes to the shutdown event afterwords. This commit checks if the manager is nullptr and ignore subscribing in that case.
This commit is contained in:
parent
4f7f58a60c
commit
38c69d8da1
@ -181,7 +181,13 @@
|
||||
*
|
||||
* @param manager - the manager to set
|
||||
*/
|
||||
void setManager(std::shared_ptr<EventManager::Manager> manager) { manager_=manager;_subscribe(EVENT_TYPE_SHUTDOWN);}
|
||||
void setManager(std::shared_ptr<EventManager::Manager> manager)
|
||||
{ manager_=manager;
|
||||
if (manager_!=nullptr)
|
||||
{
|
||||
_subscribe(EVENT_TYPE_SHUTDOWN);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Method to set the unique id of the participant
|
||||
|
Loading…
Reference in New Issue
Block a user