move runtime crash to shutdown

This commit is contained in:
lordwelch 2016-04-07 10:11:42 -07:00
parent 296ec8a94b
commit bba9f04902
2 changed files with 7 additions and 3 deletions

View File

@ -148,15 +148,15 @@ func glInit() {
qml.Func1 = func() int { qml.Func1 = func() int {
if !win.ShouldClose() { if !win.ShouldClose() {
glfw.PollEvents() //glfw.PollEvents()
drawSlide() drawSlide()
win.SwapBuffers() win.SwapBuffers()
return 0 return 0
} }
win.Hide() win.Hide()
win.Destroy() //win.Destroy()
glfw.Terminate() //glfw.Terminate()
return 1 return 1
} }

View File

@ -7,6 +7,7 @@ import (
"path/filepath" "path/filepath"
"github.com/kardianos/osext" "github.com/kardianos/osext"
"github.com/go-gl/glfw/v3.1/glfw"
"github.com/lordwelch/qml" "github.com/lordwelch/qml"
"gopkg.in/gographics/imagick.v2/imagick" "gopkg.in/gographics/imagick.v2/imagick"
) )
@ -35,6 +36,9 @@ func main() {
fmt.Fprintf(os.Stderr, "error: %v\n", err) fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1) os.Exit(1)
} }
win.Destroy()
glfw.PollEvents()
glfw.Terminate()
} }