still doesn't trap panic
This commit is contained in:
parent
9b1e7f102e
commit
25a074d02d
14
init.go
14
init.go
|
@ -4,6 +4,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
"go.wit.com/toolkits/tree"
|
"go.wit.com/toolkits/tree"
|
||||||
|
@ -123,10 +124,23 @@ func guiMain() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
// TODO: THIS IS THE PROBLEM
|
||||||
ui.Main(func() {
|
ui.Main(func() {
|
||||||
// this is a bad hack for now.
|
// this is a bad hack for now.
|
||||||
// a better way would be to spawn ui.Main on the first actual window
|
// a better way would be to spawn ui.Main on the first actual window
|
||||||
// that is supposed to be displayed
|
// that is supposed to be displayed
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
log.Log(WARN, "YAHOO andlabs GUI recovered in guiMain()")
|
||||||
|
log.Log(WARN, "Stack trace:")
|
||||||
|
debug.PrintStack()
|
||||||
|
log.Log(WARN, "Recovered from panic:", r)
|
||||||
|
log.Log(WARN, "andlabs GUI recovered in guiMain()")
|
||||||
|
log.Log(WARN, "YAHOO andlabs GUI recovered in guiMain()")
|
||||||
|
me.myTree.SendToolkitPanic()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
time.Sleep(time.Second)
|
||||||
placeholderUI()
|
placeholderUI()
|
||||||
|
|
||||||
me.myTree.InitOK()
|
me.myTree.InitOK()
|
||||||
|
|
Loading…
Reference in New Issue