vnc2video
vnc2video copied to clipboard
Update encoding_util.go
fix this panic
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x96df96]
goroutine 60 [running]:
github.com/amitbet/vnc2video.(*VncCanvas).RemoveCursor(0x0, 0xc000139b00, 0xc0003faedf)
D:/go1.13.8.windows-amd64/gopath/pkg/mod/github.com/amitbet/[email protected]/encoding_util.go:61 +0x26
github.com/amitbet/vnc2video.(*DefaultClientMessageHandler).Handle.func2(0xc0003434d0, 0xbce180, 0xc000120a00, 0xc0002e8b20, 0xc00011e500, 0xc000139b00)
D:/go1.13.8.windows-amd64/gopath/pkg/mod/github.com/amitbet/[email protected]/client.go:303 +0x2ab
created by github.com/amitbet/vnc2video.(*DefaultClientMessageHandler).Handle
D:/go1.13.8.windows-amd64/gopath/pkg/mod/github.com/amitbet/[email protected]/client.go:285 +0x2b8
I run in a goroutine, and when I create and distory frequently, it will show this panic.
I was not very sure which reason cause it, but this is my fix.