mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
Fix(?) #95: hump.gamestate causes random crashes
Overwriting love.errorhandler() causes trouble. This callback must return a game loop to display the error (see http://love2d.org/wiki/love.errorhandler). Overwriting this callback in gamestate.registerEvents() would return GS.errorhandler(), which would return nil and thus (maybe) causing LÖVE to crash. On the other hand, @lemilonkh reports that LÖVE may still crash if the love.errorhandler() is returned instead of GS.errorhandler(), so the underlying issue might be different. In any case, don't overwrite love.errorhandler, unless you know what you do.
This commit is contained in:
parent
222f99b162
commit
3ac246dd33
@ -74,8 +74,13 @@ function GS.current()
|
||||
return stack[#stack]
|
||||
end
|
||||
|
||||
-- XXX: don't overwrite love.errorhandler by default:
|
||||
-- this callback is different than the other callbacks
|
||||
-- (see http://love2d.org/wiki/love.errorhandler)
|
||||
-- overwriting thi callback can result in random crashes (issue #95)
|
||||
local all_callbacks = { 'draw', 'update' }
|
||||
|
||||
-- fetch event callbacks from love.handlers
|
||||
local all_callbacks = { 'draw', 'errorhandler', 'update' }
|
||||
for k in pairs(love.handlers) do
|
||||
all_callbacks[#all_callbacks+1] = k
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user