Stop the random map generation upon quit request (Alt+F4), refs #4822.
Differential Revision: https://code.wildfiregames.com/D1304
Discussed with: Yves
Stop the random map generation upon quit request (Alt+F4), refs #4822.
Description
Details
Event TimelineComment Actions This basically breaks random maps on OSX with a crashing error. The reason is that the callback is called from the map worker thread, and SDL_QuitRequested calls SDL_PollEvent, and OSX crashes when a secondary thread tries to poll events. Not sure if it's easily fixable or if we basically need to #ifdef this for OSX (as in general calling force-quit on an app kills it directly). (edit: it only breaks random maps as I think we use JS enough that it runs a GC? thus running the callback). Comment Actions My mistake, I should have realized myself that pulling events of the mainthread from within a secondary thread can't be thread-safe and it was printed in the documentation. Now I know. Thanks for finding out quickly what was wrong, I had no chance to reproduce! Comment Actions Indeed, as you noted this already bit us in the past so I had a pretty good idea what was wrong. Thanks for the cleanup and the patch! |