PeekMessage&massege loop in a CView function, then close window. I found the CView is destroyed, but the message loop is still running. How to explain this? That means a member function can be run even the object is released.........

See following detail?

In CView, I run a function "OnTestTest"*which is time consuming. So, I put message loop to allow GUI operation. See following code.
void CtestView::OnTestTest()
{
* *BOOL bExit = false ;
* *MSG msg;
* *while (!bExit)
* *{
* * * while ( (::PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) != FALSE) )
* * * {
* * * * * * if ( (msg.message == WM_KEYDOWN)
* * * * * * && * (msg.wParam *== VK_ESCAPE) )
* * * * * * {
* * * * * * * *bExit = true;
* * * * * * * *break;
* * * * * * } * *
* * * * * * *if(msg.message == WM_QUIT)
* * * * * * {
* * * * * * * *::PostQuitMessage(0);
* * * * * * * *bExit = true;
* * * * * * * *break;
* * * * * * }
* * * * * * if (AfxGetApp()->PreTranslateMessage( &msg ) == FALSE)
* * * * * * {
* * * * * * * *::TranslateMessage( &msg );
* * * * * * * *:ispatchMessage( &msg );
* * * * * * }* * * * * **
* * * * }
* * * if(bExit)
* * * {
* * * * *break;
* * * }
* * * else
* * * {
*//// hear is my code........
* * * }
* *}
}
When*OnTestTest is running,*if I close the program, I found the WM_DESTROY will be sent to windows (::PeekMessage can't retrieve it). Then, the OnDestroy and destruct are run.
My question is: how this happen that the view is destroyed, but the *CtestView::OnTestTest() is still running? Isn't the CtestView already released?