<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>I examined a bit more on the rare hanging when saving state.</DIV>
<DIV> </DIV>
<DIV>One message loop that may never quite is <FONT size=2></DIV>
<DIV>VBoxClipboardThread():</DIV>
<DIV> </DIV><FONT size=2>
<DIV>MSG msg;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>while</FONT></FONT><FONT size=2> (GetMessage(&msg, NULL, 0, 0) && !pCtx->fTerminate)</DIV>
<DIV>{</DIV>
<DIV>TranslateMessage(&msg);</DIV>
<DIV>DispatchMessage(&msg);</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>the above while loops depends pCtx->fTerminate to quit, however, GetMessage() may goes to sleep, so never gets to check fTerminate.</DIV>
<DIV> </DIV>
<DIV>The window proc has WM_CLOSE handler, but does nothing, needs to add something like <FONT size=2>PostQuitMessage(0), which cause GetMessage() to quit.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>There might be some other places that have similar problems.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> </DIV></FONT></FONT></FONT></td></tr></table>