Changeset - d969b377433b
[Not reviewed]
0 2 0
HanzZ - 14 years ago 2011-06-30 19:05:47
hanzz.k@gmail.com
Fixed double deletetion of User class when there's connection error
2 files changed with 9 insertions and 4 deletions:
0 comments (0 inline, 0 general)
spectrum_manager/src/spectrum_manager.cfg
Show inline comments
 
[service]
 
admin_username=admin
 
admin_password=test
 
admin_username=admin_
 
admin_password=test_
 

	
 
[servers]
 
server=localhost
 
#server=localhost
 
server=icq.spectrum.im
 
server=msn.spectrum.im
 
\ No newline at end of file
src/user.cpp
Show inline comments
 
@@ -158,11 +158,15 @@ void User::handleDisconnected(const std::string &error) {
 
	msg->setFrom(m_component->getJID());
 
	m_component->getStanzaChannel()->sendMessage(msg);
 

	
 
	// In server mode, server finishes the session and pass unavailable session to userManager,
 
	// so we can't removeUser() in server mode, because it would be removed twice.
 
	// Once in finishSession and once in m_userManager->removeUser.
 
	if (m_component->inServerMode()) {
 
		dynamic_cast<Swift::ServerStanzaChannel *>(m_component->getStanzaChannel())->finishSession(m_jid, boost::shared_ptr<Swift::Element>(new Swift::StreamError()));
 
	}
 

	
 
	else {
 
		m_userManager->removeUser(this);
 
	}
 
}
 

	
 
}
0 comments (0 inline, 0 general)