Changeset - 83bf526fbce9
[Not reviewed]
0 2 0
HanzZ - 14 years ago 2011-06-12 16:35:12
hanzz.k@gmail.com
Fixed deadlock while removing conversations
2 files changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/conversation.cpp
Show inline comments
 
@@ -29,12 +29,13 @@
 
namespace Transport {
 

	
 
Conversation::Conversation(ConversationManager *conversationManager, const std::string &legacyName, bool isMUC) : m_conversationManager(conversationManager) {
 
	m_legacyName = legacyName;
 
	m_conversationManager->addConversation(this);
 
	m_muc = isMUC;
 
	std::cout << "new conversation " << legacyName << "\n";
 
}
 

	
 
Conversation::~Conversation() {
 
	m_conversationManager->removeConversation(this);
 
}
 

	
src/conversationmanager.cpp
Show inline comments
 
@@ -34,12 +34,13 @@ ConversationManager::ConversationManager(User *user, Component *component){
 
	m_user = user;
 
	m_component = component;
 
}
 

	
 
ConversationManager::~ConversationManager() {
 
	while(!m_convs.empty()) {
 
		m_convs.erase(m_convs.begin());
 
		delete (*m_convs.begin()).second;
 
	}
 
}
 

	
 
void ConversationManager::addConversation(Conversation *conv) {
 
	m_convs[conv->getLegacyName()] = conv;
0 comments (0 inline, 0 general)