veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.17k stars 219 forks source link

mix: avoid segfault race condition on HookMusicFinished #567

Closed Lundis closed 1 year ago

Lundis commented 1 year ago

I got a segfault because hookMusicFinishedFunc was nil after I disabled the hook by

HookMusicFinished(nil)

At the same time as I faded out my old music. This if statement should take care of it.

veeableful commented 1 year ago

Thank you @Lundis for the fix! I will merge it.