Fixed event broker unsubscribe bug where event relay would still think it belonged to a broker after unsubscribed

This commit is contained in:
2015-09-16 12:54:34 +02:00
parent e31f5e054e
commit 4cfa0ef624
2 changed files with 1 additions and 9 deletions
-9
View File
@@ -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__
+1
View File
@@ -40,6 +40,7 @@ void dd::EventBroker::Unsubscribe(BaseEventRelay &relay) // ?
{
if (it->second == &relay)
{
relay.m_Broker = nullptr;
eventRelays.erase(it);
break;
}