diff -r a232af6b0b1f -r a5496987b1da userlibandfileserver/fileserver/sfat32/fat_table32.cpp --- a/userlibandfileserver/fileserver/sfat32/fat_table32.cpp Wed Jun 23 12:58:21 2010 +0100 +++ b/userlibandfileserver/fileserver/sfat32/fat_table32.cpp Thu Jul 01 17:57:33 2010 +0100 @@ -692,7 +692,7 @@ CAtaFatTable::CAtaFatTable(CFatMountCB& aOwner) :CFatTable(aOwner), iDriveInteface(aOwner.DriveInterface()) { - iState = ENotInitialised; + iState = ENotInitialised; } @@ -1044,10 +1044,16 @@ //-- create helper thread object and start the thread ipHelperThread = CFat32BitCachePopulator::NewL(*this); - ipHelperThread->Launch(); - //-- background FAT bit cache populating thread is running now. - //-- the result of thread start up and completion isn't very interesting: If it fails to - //-- properly populate the cache, nothing fatal will happen. + if(ipHelperThread->Launch() != KErrNone) + {//-- failed for some reason + DestroyHelperThread(); + } + else + { + //-- background FAT bit cache populating thread is running now. + //-- the result of thread start up and completion isn't very interesting: If it fails to + //-- properly populate the cache, nothing fatal will happen. + } } //-- CFat32BitCachePopulator doesn't affect FAT table state. @@ -1480,7 +1486,7 @@ {//-- test property for this drive is defined if(nMntDebugFlags & KMntDisable_FatBkGndScan) { - __PRINT(_L("#- FAT32 BkGnd scan is disabled is disabled by debug interface.")); + __PRINT(_L("#- FAT32 BkGnd scan is disabled by debug interface.")); bFat32BkGndScan = EFalse; } @@ -1544,7 +1550,8 @@ SetState(EFreeClustersScan); - ipHelperThread->Launch(); + User::LeaveIfError(ipHelperThread->Launch()); + //-- background FAT scanning thread is running now } @@ -1964,8 +1971,8 @@ return nRes; } - //-- Helper FAT thread is running now - return KErrNone; + //-- Helper FAT thread is running now + return KErrNone; } @@ -1983,7 +1990,8 @@ /** Launches the FAT32_ScanThread scaner thread. - @return standard error code + @return KErrNone if the thread launched OK + standard error code otherwise */ TInt CFat32ScanThread::Launch() {