move runtime crash to shutdown
This commit is contained in:
parent
296ec8a94b
commit
bba9f04902
6
glfw.go
6
glfw.go
@ -148,15 +148,15 @@ func glInit() {
|
||||
|
||||
qml.Func1 = func() int {
|
||||
if !win.ShouldClose() {
|
||||
glfw.PollEvents()
|
||||
//glfw.PollEvents()
|
||||
drawSlide()
|
||||
win.SwapBuffers()
|
||||
return 0
|
||||
|
||||
}
|
||||
win.Hide()
|
||||
win.Destroy()
|
||||
glfw.Terminate()
|
||||
//win.Destroy()
|
||||
//glfw.Terminate()
|
||||
return 1
|
||||
|
||||
}
|
||||
|
4
main.go
4
main.go
@ -7,6 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/kardianos/osext"
|
||||
"github.com/go-gl/glfw/v3.1/glfw"
|
||||
"github.com/lordwelch/qml"
|
||||
"gopkg.in/gographics/imagick.v2/imagick"
|
||||
)
|
||||
@ -35,6 +36,9 @@ func main() {
|
||||
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
win.Destroy()
|
||||
glfw.PollEvents()
|
||||
glfw.Terminate()
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user