diff -r 235a7fc86938 -r 2edacbf5d3f9 imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtask.cpp --- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtask.cpp Tue Feb 02 00:23:15 2010 +0200 +++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailtask.cpp Fri Mar 19 09:35:30 2010 +0200 @@ -51,6 +51,8 @@ { Cancel(); CancelMessage(); + + iClientThread.Close(); } @@ -225,4 +227,49 @@ } } +// --------------------------------------------------------------------------- +// CThumbnailTask::ClientThreadAlive() +// Checks if client thread is still alive and RMessage2 handle valid. +// --------------------------------------------------------------------------- +// +TBool CThumbnailTask::ClientThreadAlive(const TBool aGetThread) + { + if ( iMessage.Handle()) + { + if (aGetThread) + { + // get client thread + TInt err = iMessage.Client( iClientThread ); + if (err != KErrNone) + { + TN_DEBUG2( "CThumbnailTask(0x%08x)::ClientThreadAlive() - client thread not found", this); + + ResetMessageData(); + + return EFalse; + } + } + + // check if client thread alive + TExitType exitType = iClientThread.ExitType(); + if( exitType != EExitPending ) + { + TN_DEBUG2( "CThumbnailTask(0x%08x)::ClientThreadAlive() - client thread died", this); + + ResetMessageData(); + + return EFalse; + } + else + { + // all OK + return ETrue; + } + } + else + { + return EFalse; + } + } + // End of file