|
|
@ -15,8 +15,16 @@ namespace smx_config |
|
|
|
{ |
|
|
|
{ |
|
|
|
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionEventHandler; |
|
|
|
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionEventHandler; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!SMX.SMX.DLLAvailable()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
MessageBox.Show("SMXConfig encountered an unexpected error:\n\nSMX.dll failed to load.", "SMXConfig"); |
|
|
|
|
|
|
|
Current.Shutdown(); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(Helpers.GetDebug()) |
|
|
|
if(Helpers.GetDebug()) |
|
|
|
SMX_Internal_OpenConsole(); |
|
|
|
SMX_Internal_OpenConsole(); |
|
|
|
|
|
|
|
|
|
|
|
CurrentSMXDevice.singleton = new CurrentSMXDevice(); |
|
|
|
CurrentSMXDevice.singleton = new CurrentSMXDevice(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -32,6 +40,8 @@ namespace smx_config |
|
|
|
|
|
|
|
|
|
|
|
// Shut down cleanly, to make sure we don't run any threaded callbacks during shutdown. |
|
|
|
// Shut down cleanly, to make sure we don't run any threaded callbacks during shutdown. |
|
|
|
Console.WriteLine("Application exiting"); |
|
|
|
Console.WriteLine("Application exiting"); |
|
|
|
|
|
|
|
if(CurrentSMXDevice.singleton == null) |
|
|
|
|
|
|
|
return; |
|
|
|
CurrentSMXDevice.singleton.Shutdown(); |
|
|
|
CurrentSMXDevice.singleton.Shutdown(); |
|
|
|
CurrentSMXDevice.singleton = null; |
|
|
|
CurrentSMXDevice.singleton = null; |
|
|
|
} |
|
|
|
} |
|
|
|