Skip to content

Commit

Permalink
macOS: Fix a crash when the video subsystem quits, if SDL_MAC_NO_SAND…
Browse files Browse the repository at this point in the history
…BOX was defined when SDL was compiled.
  • Loading branch information
slime73 committed Sep 30, 2018
1 parent 56ec349 commit fb48598
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/video/cocoa/SDL_cocoamousetap.m
Expand Up @@ -237,6 +237,13 @@
SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)driverdata->tapdata;
int status;

if (tapdata == NULL) {
/* event tap was already cleaned up (possibly due to CGEventTapCreate
* returning null.)
*/
return;
}

/* Ensure that the runloop has been started first.
* TODO: Move this to InitMouseEventTap, check for error conditions that can
* happen in Cocoa_MouseTapThread, and fall back to the non-EventTap way of
Expand Down

0 comments on commit fb48598

Please sign in to comment.