summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-11 19:30:05 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-11 19:30:05 +0300
commit0984b817b1bfed9b8b475f7c79d1627e5037e914 (patch)
treeed9ba8e7bb29cee25c1efe6fc0442c8d1769b950
parentc83d3a41abcae15b1198b692502bc8b9879a10ab (diff)
downloadmanaplus-0984b817b1bfed9b8b475f7c79d1627e5037e914.tar.gz
manaplus-0984b817b1bfed9b8b475f7c79d1627e5037e914.tar.bz2
manaplus-0984b817b1bfed9b8b475f7c79d1627e5037e914.tar.xz
manaplus-0984b817b1bfed9b8b475f7c79d1627e5037e914.zip
Fix chat room properties if two time join and part chat room.
-rw-r--r--src/resources/chatobject.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resources/chatobject.cpp b/src/resources/chatobject.cpp
index a3582e3d6..0c617f6dc 100644
--- a/src/resources/chatobject.cpp
+++ b/src/resources/chatobject.cpp
@@ -38,10 +38,10 @@ ChatObject::ChatObject() :
ChatObject::~ChatObject()
{
std::map<std::string, ChatObject*>::iterator it = chatNameMap.find(title);
- if (it != chatNameMap.end())
+ if (it != chatNameMap.end() && (*it).second == this)
chatNameMap.erase(it);
std::map<int, ChatObject*>::iterator it2 = chatIdMap.find(chatId);
- if (it2 != chatIdMap.end())
+ if (it2 != chatIdMap.end() && (*it2).second == this)
chatIdMap.erase(it2);
}