g3n / engine

Go 3D Game Engine (http://g3n.rocks)
https://discord.gg/NfaeVr8zDg
BSD 2-Clause "Simplified" License
2.8k stars 295 forks source link

Crash resizing demo's window #1 #94

Closed nitrix closed 2 years ago

nitrix commented 6 years ago

Hello.

I was playing with the demo v0.5, went to gui > window and tried resizing the "Window 1" when I got a crash. This is reproducible every time for me on Windows 10.

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

goroutine 1 [running, locked to thread]:
github.com/g3n/engine/gui.(*Window).onCursor(0xc04207ce00, 0x810b75, 0xc, 0x73dfa0, 0xc042136278)
        C:/Users/nitrix/go/src/github.com/g3n/engine/gui/window.go:185 +0x226
github.com/g3n/engine/gui.(*Window).(github.com/g3n/engine/gui.onCursor)-fm(0x810b75, 0xc, 0x73dfa0, 0xc042136278)
        C:/Users/nitrix/go/src/github.com/g3n/engine/gui/window.go:78 +0x59
github.com/g3n/engine/core.(*Dispatcher).Dispatch(0xc042e7c480, 0x810b75, 0xc, 0x73dfa0, 0xc042136278, 0x0)
        C:/Users/nitrix/go/src/github.com/g3n/engine/core/dispatcher.go:113 +0xe0
github.com/g3n/engine/gui.(*Root).sendPanels(0xc0420dafc0, 0x431f000043d88000, 0x810b75, 0xc, 0x73dfa0, 0xc042136278)
        C:/Users/nitrix/go/src/github.com/g3n/engine/gui/root.go:281 +0x54f
github.com/g3n/engine/gui.(*Root).onCursor(0xc0420dafc0, 0x810b75, 0xc, 0x73dfa0, 0xc042136278)
        C:/Users/nitrix/go/src/github.com/g3n/engine/gui/root.go:263 +0x80
github.com/g3n/engine/gui.(*Root).(github.com/g3n/engine/gui.onCursor)-fm(0x810b75, 0xc, 0x73dfa0, 0xc042136278)
        C:/Users/nitrix/go/src/github.com/g3n/engine/gui/root.go:62 +0x59
github.com/g3n/engine/core.(*Dispatcher).Dispatch(0xc042136160, 0x810b75, 0xc, 0x73dfa0, 0xc042136278, 0xc042184048)
        C:/Users/nitrix/go/src/github.com/g3n/engine/core/dispatcher.go:113 +0xe0
github.com/g3n/engine/window.(*glfwManager).CreateWindow.func6(0xc0420b4200, 0x407b100000000000, 0x4063e00000000000)
        C:/Users/nitrix/go/src/github.com/g3n/engine/window/glfw.go:287 +0xb5
github.com/go-gl/glfw/v3.2/glfw.goCursorPosCB(0x57822c0, 0x407b100000000000, 0x4063e00000000000)
        C:/Users/nitrix/go/src/github.com/go-gl/glfw/v3.2/glfw/input.go:269 +0x68
github.com/go-gl/glfw/v3.2/glfw._cgoexpwrap_d70d5d984431_goCursorPosCB(0x57822c0, 0x407b100000000000, 0x4063e00000000000)
        _cgo_gotypes.go:2049 +0x4a
github.com/go-gl/glfw/v3.2/glfw._Cfunc_glfwPollEvents()
        _cgo_gotypes.go:1150 +0x48
github.com/go-gl/glfw/v3.2/glfw.PollEvents()
        C:/Users/nitrix/go/src/github.com/go-gl/glfw/v3.2/glfw/window.go:777 +0x27
github.com/g3n/engine/window.(*glfwManager).PollEvents(0xc0420b2280)
        C:/Users/nitrix/go/src/github.com/g3n/engine/window/glfw.go:128 +0x27
github.com/g3n/engine/util/application.(*Application).Run(0xc042062280, 0x0, 0x0)
        C:/Users/nitrix/go/src/github.com/g3n/engine/util/application/application.go:477 +0x2ec
main.main()
        C:/Users/nitrix/go/src/github.com/g3n/g3nd/main.go:28 +0x54
AL lib: (EE) alc_cleanup: 1 device not closed
gamerscomplete commented 6 years ago

ran into the same issue few hours ago. problem was due to that window not having a title and it using the title like the others. i have a fix i just made for it, ill send a pull request here shortly

danaugrs commented 2 years ago

Thanks @nitrix and @gamerscomplete,I believe this is fixed. Please open a new issue if you encounter it again!