g3n / g3nd

G3N Game Engine Demo
BSD 2-Clause "Simplified" License
279 stars 32 forks source link

Panic on gui/splitter #1

Closed hgfischer closed 7 years ago

hgfischer commented 7 years ago

While sequentially exploring the demo, I got the following exception when I was testing the splitter demo.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x418 pc=0x5e0572]

goroutine 1 [running, locked to thread]:
github.com/g3n/engine/gui.(*Root).SetCursorVResize(0x0)
    /home/herbert/Workspace/Go/src/github.com/g3n/engine/gui/root.go:163 +0x22
github.com/g3n/engine/gui.(*Splitter).onCursor(0xc420a3f000, 0x82a032, 0x11, 0x76c680, 0xc4205f5118)
    /home/herbert/Workspace/Go/src/github.com/g3n/engine/gui/splitter.go:148 +0x15b
github.com/g3n/engine/gui.(*Splitter).(github.com/g3n/engine/gui.onCursor)-fm(0x82a032, 0x11, 0x76c680, 0xc4205f5118)
    /home/herbert/Workspace/Go/src/github.com/g3n/engine/gui/splitter.go:84 +0x52
github.com/g3n/engine/core.(*Dispatcher).Dispatch(0xc420a3fbd8, 0x82a032, 0x11, 0x76c680, 0xc4205f5118, 0xc420000100)
    /home/herbert/Workspace/Go/src/github.com/g3n/engine/core/dispatcher.go:104 +0xbf
github.com/g3n/engine/gui.(*Root).sendPanels(0xc420132000, 0x43c5800043570000, 0x827aef, 0xc, 0x76c680, 0xc4205f5118)
    /home/herbert/Workspace/Go/src/github.com/g3n/engine/gui/root.go:290 +0x40f
github.com/g3n/engine/gui.(*Root).onCursor(0xc420132000, 0x827aef, 0xc, 0x76c680, 0xc4205f5118)
    /home/herbert/Workspace/Go/src/github.com/g3n/engine/gui/root.go:209 +0x79
github.com/g3n/engine/gui.(*Root).(github.com/g3n/engine/gui.onCursor)-fm(0x827aef, 0xc, 0x76c680, 0xc4205f5118)
    /home/herbert/Workspace/Go/src/github.com/g3n/engine/gui/root.go:57 +0x52
github.com/g3n/engine/core.(*Dispatcher).Dispatch(0xc4205f5040, 0x827aef, 0xc, 0x76c680, 0xc4205f5118, 0x22c6c10)
    /home/herbert/Workspace/Go/src/github.com/g3n/engine/core/dispatcher.go:104 +0xbf
github.com/g3n/engine/window.newGLFW.func6(0xc4200da280, 0x406ae00000000000, 0x4078b00000000000)
    /home/herbert/Workspace/Go/src/github.com/g3n/engine/window/glfw.go:142 +0xa9
github.com/go-gl/glfw/v3.2/glfw.goCursorPosCB(0x22c6c10, 0x406ae00000000000, 0x4078b00000000000)
    /home/herbert/Workspace/Go/src/github.com/go-gl/glfw/v3.2/glfw/input.go:267 +0x61
github.com/go-gl/glfw/v3.2/glfw._cgoexpwrap_1abbaa5bda2c_goCursorPosCB(0x22c6c10, 0x406ae00000000000, 0x4078b00000000000)
    github.com/go-gl/glfw/v3.2/glfw/_obj/_cgo_gotypes.go:2087 +0x43
github.com/go-gl/glfw/v3.2/glfw._Cfunc_glfwPollEvents()
    github.com/go-gl/glfw/v3.2/glfw/_obj/_cgo_gotypes.go:1188 +0x41
github.com/go-gl/glfw/v3.2/glfw.PollEvents()
    /home/herbert/Workspace/Go/src/github.com/go-gl/glfw/v3.2/glfw/window.go:752 +0x20
github.com/g3n/engine/window.(*GLFW).PollEvents(0xc4205f5040)
    /home/herbert/Workspace/Go/src/github.com/g3n/engine/window/glfw.go:237 +0x20
main.main()
    /home/herbert/Workspace/Go/src/github.com/g3n/g3nd/main.go:252 +0xf48
leonsal commented 7 years ago

Hi, it seems to be fixed now. Thanks !