mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 11:35:08 -04:00
Fix 'classicalsharp has crashed' dialog being shown multiple times in the launcher.
This commit is contained in:
parent
a362366ef4
commit
819dfc434f
@ -70,6 +70,7 @@ namespace Launcher2 {
|
||||
}
|
||||
|
||||
void FocusedChanged( object sender, EventArgs e ) {
|
||||
if( Program.ShowingErrorDialog ) return;
|
||||
MakeBackground();
|
||||
Screen.Resize();
|
||||
}
|
||||
|
@ -10,13 +10,20 @@ namespace Launcher2 {
|
||||
|
||||
public static string AppDirectory;
|
||||
|
||||
public static bool ShowingErrorDialog = false;
|
||||
|
||||
[STAThread]
|
||||
static void Main( string[] args ) {
|
||||
AppDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
string logPath = Path.Combine( AppDirectory, "launcher.log" );
|
||||
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
|
||||
ErrorHandler.InstallHandler( logPath );
|
||||
LauncherWindow window = new LauncherWindow();
|
||||
window.Run();
|
||||
}
|
||||
|
||||
static void UnhandledExceptionHandler( object sender, UnhandledExceptionEventArgs e ) {
|
||||
ShowingErrorDialog = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user