diff -r 345b1ca54e88 -r 039a3e647356 userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmssession.cpp --- a/userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmssession.cpp Wed Sep 15 13:42:27 2010 +0300 +++ b/userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmssession.cpp Wed Oct 13 16:04:24 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of the License "Eclipse Public License v1.0" @@ -114,16 +114,8 @@ return; } break; - case EUsbHostMsUnRegisterInterface: - if(iCleanupInProgress) - { - aMessage.Complete(KErrInUse); - return; - } - else - { - iCleanupInProgress = ETrue; - } + case EUsbHostMsUnRegisterInterface: + iCleanupInProgress = ETrue; break; /* If it is a cleanup then we need to delete the iDeviceThread */ case EUsbHostMsFinalCleanup: @@ -136,17 +128,12 @@ break; } - if (iDeviceThread == NULL) + if (iDeviceThread == NULL || iCleanupInProgress ) { aMessage.Complete(KErrBadHandle); return; } - if (iCleanupInProgress && aMessage.Function() != EUsbHostMsUnRegisterInterface) - { - aMessage.Complete(KErrBadHandle); - return; - } r = iDeviceThread->QueueMsg(aMessage); if (r != KErrNone)