Add panic recovery to catch the panic message

This commit is contained in:
Nova 2025-11-27 12:05:04 +03:30
parent ca3da15056
commit 6296e6a8bd
2 changed files with 7 additions and 1 deletions

View File

@ -64,6 +64,13 @@ func RunCore() {
} }
func main() { func main() {
defer func() {
if err := recover(); err != nil {
fmt.Println("Core panicked:")
fmt.Println(err)
os.Exit(0)
}
}()
fmt.Println("sing-box:", C.Version) fmt.Println("sing-box:", C.Version)
fmt.Println() fmt.Println()
runtimeDebug.SetMemoryLimit(2 * 1024 * 1024 * 1024) // 2GB runtimeDebug.SetMemoryLimit(2 * 1024 * 1024 * 1024) // 2GB

View File

@ -970,7 +970,6 @@ void MainWindow::prepare_exit()
return; return;
} }
hide(); hide();
// tray->hide();
Configs::dataStore->prepare_exit = true; Configs::dataStore->prepare_exit = true;
// //
RegisterHiddenMenuShortcuts(true); RegisterHiddenMenuShortcuts(true);