Skip to content

Commit

Permalink
Version 1.6.2
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
daviunic committed Mar 24, 2020
1 parent 09069a1 commit e51cfd1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 86BoxManager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.6.1.0")]
[assembly: AssemblyFileVersion("1.6.1.0")]
[assembly: AssemblyVersion("1.6.2.0")]
[assembly: AssemblyFileVersion("1.6.2.0")]
8 changes: 6 additions & 2 deletions 86BoxManager/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,11 @@ private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
lvi.Focused = true;
lvi.Selected = true;
VMForceStop(); //Tell the VM to shut down without asking for user confirmation
Process p = Process.GetProcessById(vm.Pid);
p.WaitForExit(500); //Wait 500 milliseconds for each VM to close
}
}

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

p.Start();
vm.Pid = p.Id;

bool initSuccess = p.WaitForInputIdle(launchTimeout); //Wait for the specified amount of time so hWnd can be obtained

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

0 comments on commit e51cfd1

Please sign in to comment.