g3n / demos

Standalone demos for G3N Game Engine
BSD 2-Clause "Simplified" License
14 stars 12 forks source link

panic on window resizing #9

Open astef opened 6 months ago

astef commented 6 months ago
  1. Open gui -> window
  2. Try to resize Window 1 (white one)

Result: application crashes

Output:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x90 pc=0x7ff65dbe1eee]

goroutine 1 [running, locked to thread]:
github.com/g3n/engine/gui.(*Window).onCursor(0xc000005c08, {0x7ff65dfa2489?, 0x7ff65dd33410?}, {0x7ff65def4440?, 0xc0000ea0a8})
        C:/Users/astef/go/pkg/mod/github.com/g3n/engine@v0.2.0/gui/window.go:190 +0x22e
github.com/g3n/engine/core.(*Dispatcher).Dispatch(0x0?, {0x7ff65dfa2489, 0xa}, {0x7ff65def4440, 0xc0000ea0a8})
        C:/Users/astef/go/pkg/mod/github.com/g3n/engine@v0.2.0/core/dispatcher.go:109 +0x8b
github.com/g3n/engine/gui.(*manager).onCursor(0xa?, {0x7ff65dfa2489?, 0x7ff65da1fd1b?}, {0x7ff65def4440?, 0xc0000ea0a8?})
        C:/Users/astef/go/pkg/mod/github.com/g3n/engine@v0.2.0/gui/manager.go:171 +0x1ae
github.com/g3n/engine/core.(*Dispatcher).Dispatch(0xc0000ec000?, {0x7ff65dfa2489, 0xa}, {0x7ff65def4440, 0xc0000ea0a8})
        C:/Users/astef/go/pkg/mod/github.com/g3n/engine@v0.2.0/core/dispatcher.go:109 +0x8b
github.com/g3n/engine/window.Init.func6(0xc000031bd8?, 0x7ff65da1e1e5?, 0xc000054000?)
        C:/Users/astef/go/pkg/mod/github.com/g3n/engine@v0.2.0/window/glfw.go:353 +0x5e
github.com/go-gl/glfw/v3.3/glfw.goCursorPosCB(0x7ff65da51c29?, 0x4072c00000000000, 0x4064400000000000)
        C:/Users/astef/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20211213063430-748e38ca8aec/input.go:340 +0x3e
github.com/go-gl/glfw/v3.3/glfw._Cfunc_glfwPollEvents()
        _cgo_gotypes.go:1540 +0x49
github.com/go-gl/glfw/v3.3/glfw.PollEvents()
        C:/Users/astef/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20211213063430-748e38ca8aec/window.go:964 +0xf
github.com/g3n/engine/window.(*GlfwWindow).PollEvents(...)
        C:/Users/astef/go/pkg/mod/github.com/g3n/engine@v0.2.0/window/glfw.go:433
github.com/g3n/engine/app.(*Application).Run(0xc00006c180, 0xc000031ef8)
        C:/Users/astef/go/pkg/mod/github.com/g3n/engine@v0.2.0/app/app-desktop.go:91 +0x8a
github.com/g3n/g3nd/app.(*App).Run(0xc000076140)
        C:/proj/pub/g3nd/app/app.go:623 +0x294
main.main()
        C:/proj/pub/g3nd/main.go:24 +0x18
AL lib: (EE) alc_cleanup: 1 device not closed
exit status 2