diff -r 453dfc402455 -r 0aa8cc770c8a backupandrestore/backupengine/src/absession.cpp --- a/backupandrestore/backupengine/src/absession.cpp Thu Aug 19 10:44:03 2010 +0300 +++ b/backupandrestore/backupengine/src/absession.cpp Tue Aug 31 16:03:15 2010 +0300 @@ -148,7 +148,12 @@ iCallbackWatchdog = NULL; // Remove this session from the server's session map - Server().RemoveElement(iClientSID); + // Use dynamic_cast in case that ABServer is deconstructing + CABServer *pServer = dynamic_cast(const_cast(CSession2::Server())); + if(pServer) + { + pServer->RemoveElement(iClientSID); + } // Clear up any outstanding message HandleIPCClosingDownCallback(); @@ -159,7 +164,10 @@ // If the client has detached properly, they should // have done this - but just in case. //DoCancelWaitForCallback(); - Server().DropSession(); + if(pServer) + { + pServer->DropSession(); + } } void CABSession::CreateL()