Skip to content
This repository was archived by the owner on Aug 23, 2025. It is now read-only.

Commit e51cfd1

Browse files
committed
Version 1.6.2
The result of WaitForInputIdle() call is now ignored if a window handle can be obtained anyway. This should work around the timeout issues introduced by 86Box build 2102 (compiled with GCC 9.3.0). Manager now also properly waits for each VM to close when closing running VMs before exit (500 miliseconds per VM).
1 parent 09069a1 commit e51cfd1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

86BoxManager/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333

34-
[assembly: AssemblyVersion("1.6.1.0")]
35-
[assembly: AssemblyFileVersion("1.6.1.0")]
34+
[assembly: AssemblyVersion("1.6.2.0")]
35+
[assembly: AssemblyFileVersion("1.6.2.0")]

86BoxManager/frmMain.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,10 +513,11 @@ private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
513513
lvi.Focused = true;
514514
lvi.Selected = true;
515515
VMForceStop(); //Tell the VM to shut down without asking for user confirmation
516+
Process p = Process.GetProcessById(vm.Pid);
517+
p.WaitForExit(500); //Wait 500 milliseconds for each VM to close
516518
}
517519
}
518520

519-
Thread.Sleep(vmCount * 500); //Wait just a bit to make sure everything goes as planned
520521
}
521522
else if (DialogResult == DialogResult.Cancel)
522523
{
@@ -605,9 +606,12 @@ private void VMStart()
605606

606607
p.Start();
607608
vm.Pid = p.Id;
609+
608610
bool initSuccess = p.WaitForInputIdle(launchTimeout); //Wait for the specified amount of time so hWnd can be obtained
609611

610-
if (!p.MainWindowHandle.Equals(IntPtr.Zero) && initSuccess)
612+
//initSuccess is ignored for now because WaitForInputIdle() likes to return false more often now that
613+
//86Box is compiled with GCC 9.3.0...
614+
if (!p.MainWindowHandle.Equals(IntPtr.Zero) /*&& initSuccess*/)
611615
{
612616
vm.hWnd = p.MainWindowHandle; //Get the window handle of the newly created process
613617
vm.Status = VM.STATUS_RUNNING;

0 commit comments

Comments
 (0)