Fixed event broker unsubscribe bug where event relay would still think it belonged to a broker after unsubscribed
This commit is contained in:
@@ -121,8 +121,6 @@ public:
|
||||
int Process(std::string contextTypeName);
|
||||
void Clear();
|
||||
void Unsubscribe(BaseEventRelay &relay);
|
||||
template <typename ContextType>
|
||||
void UnsubscribeAll();
|
||||
|
||||
private:
|
||||
typedef std::string ContextTypeName_t; // typeid(ContextType).name()
|
||||
@@ -156,13 +154,6 @@ int EventBroker::Process()
|
||||
return Process(contextTypeName);
|
||||
}
|
||||
|
||||
template <typename ContextType>
|
||||
void EventBroker::UnsubscribeAll()
|
||||
{
|
||||
const std::string contextTypeName = typeid(ContextType).name();
|
||||
m_ContextRelays.erase(contextTypeName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // MessageRelay_h__
|
||||
|
||||
@@ -40,6 +40,7 @@ void dd::EventBroker::Unsubscribe(BaseEventRelay &relay) // ?
|
||||
{
|
||||
if (it->second == &relay)
|
||||
{
|
||||
relay.m_Broker = nullptr;
|
||||
eventRelays.erase(it);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user