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 {
|
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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
4
main.go
4
main.go
@ -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()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user