<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>I continue to debug the crash bug when shutting down a vm on windows host.</DIV>
<DIV> </DIV>
<DIV>The crash indicated that some code is still being executed after a dll is unloaded. </DIV>
<DIV> </DIV>
<DIV>After some extensive debugging, I found the following function might be problematic. Can you guys double check?</DIV>
<DIV> </DIV>
<DIV>When WM_VBOX_RENDERSPU_DESTROY_WINDOW is received, it immediately invokes SetEvent(render_spu.hWinThreadReadyEvent), should that statement be commented out? and leave the last one.</DIV>
<DIV> </DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<DIV>static</FONT></FONT><FONT size=2> DWORD WINAPI renderSPUWindowThreadProc(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>void</FONT></FONT><FONT size=2>* unused)</DIV>
<DIV>{</DIV>
<DIV>...</DIV></FONT><FONT size=2>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</DIV></FONT></FONT><FONT size=2>
<DIV>{</DIV></FONT><FONT size=2>
<DIV>...</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2></FONT></FONT> </DIV>
<DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (msg.message == WM_VBOX_RENDERSPU_DESTROY_WINDOW)</DIV>
<DIV>{</DIV>
<DIV>CRASSERT(msg.lParam && !msg.wParam);</DIV>
<DIV>DestroyWindow(((VBOX_RENDERSPU_DESTROY_WINDOW*) msg.lParam)->hWnd);</DIV>
<DIV>SetEvent(render_spu.hWinThreadReadyEvent);</DIV>
<DIV>}</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</DIV></FONT></FONT><FONT size=2>
<DIV>{</DIV>
<DIV>TranslateMessage(&msg);</DIV>
<DIV>DispatchMessage(&msg);</DIV>
<DIV>}</DIV>
<DIV>}</DIV>
<DIV>}</DIV>
<DIV>render_spu.dwWinThreadId = 0;</DIV>
<DIV>crDebug(</FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"RenderSPU: Window thread stopped (%x)"</FONT></FONT><FONT size=2>, crThreadID());</DIV>
<DIV>SetEvent(render_spu.hWinThreadReadyEvent);</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> 0;</DIV>
<DIV>}</DIV></FONT></td></tr></table>