mirror of
https://github.com/mastercodeon314/KsDumper-11.git
synced 2024-11-27 16:00:53 +01:00
Fixed a bug that wouldn't allow the form to unload the driver on program exit.
This commit is contained in:
parent
a165027b78
commit
b7cc4a3dfc
@ -133,7 +133,14 @@ namespace KsDumper11.Driver
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
WinApi.CloseHandle(driverHandle);
|
||||
try
|
||||
{
|
||||
WinApi.CloseHandle(driverHandle);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
~DriverInterface()
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -105,6 +105,7 @@ namespace KsDumper11
|
||||
this.InitializeComponent();
|
||||
closeDriverOnExitBox.Checked = Properties.Settings.Default.closeDriverOnExitSettings;
|
||||
this.FormClosing += Dumper_FormClosing;
|
||||
this.Disposed += Dumper_Disposed;
|
||||
this.appIcon1.DragForm = this;
|
||||
base.FormBorderStyle = FormBorderStyle.None;
|
||||
base.Region = Region.FromHrgn(Utils.CreateRoundRectRgn(0, 0, base.Width, base.Height, 10, 10));
|
||||
@ -123,6 +124,14 @@ namespace KsDumper11
|
||||
this.LoadProcessList();
|
||||
}
|
||||
|
||||
private void Dumper_Disposed(object sender, EventArgs e)
|
||||
{
|
||||
if (Properties.Settings.Default.closeDriverOnExitSettings)
|
||||
{
|
||||
driver.UnloadDriver();
|
||||
}
|
||||
}
|
||||
|
||||
private void closeDriverOnExitBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.closeDriverOnExitSettings = closeDriverOnExitBox.Checked;
|
||||
|
Loading…
Reference in New Issue
Block a user