Commit 462d1ba2 authored by David Faure's avatar David Faure
Browse files

Fix crashes due to deleted Session pointers being kept around.

And fix LogoutJob never going through in the idle session, because the IdleJob
runs forever. The idle job has to be stopped, first.

Tested with kDebugs and using 'RMB / Toggle online/offline'

Both fixes suggested by Kévin when discussing the issue with him.

BUGS: 288268
CCBUG: 258271
FIXED-IN: 4.8
parent 49d44c55
......@@ -49,6 +49,9 @@ ImapIdleManager::ImapIdleManager( ResourceStateInterface::Ptr state,
ImapIdleManager::~ImapIdleManager()
{
if ( m_idle ) {
m_idle->stop();
}
if ( m_pool && m_session ) {
m_pool->releaseSession( m_session );
}
......
......@@ -177,6 +177,8 @@ void SessionPool::killSession( KIMAP::Session *session, SessionTermination termi
this, SLOT(onEarlyConnectionLost()) );
QObject::disconnect( session, SIGNAL(connectionLost()),
this, SLOT(onConnectionLost()) );
m_idlePool.removeAll( session );
m_reservedPool.removeAll( session );
if ( session->state() != KIMAP::Session::Disconnected && termination == LogoutSession ) {
KIMAP::LogoutJob *logout = new KIMAP::LogoutJob( session );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment