diff --git a/include/EventManager/Participant.hpp b/include/EventManager/Participant.hpp index 0ca39e2..894948c 100644 --- a/include/EventManager/Participant.hpp +++ b/include/EventManager/Participant.hpp @@ -181,7 +181,13 @@ * * @param manager - the manager to set */ - void setManager(std::shared_ptr manager) { manager_=manager;_subscribe(EVENT_TYPE_SHUTDOWN);} + void setManager(std::shared_ptr manager) + { manager_=manager; + if (manager_!=nullptr) + { + _subscribe(EVENT_TYPE_SHUTDOWN); + } + } /** * @brief Method to set the unique id of the participant