[Commits] SDL: macOS: Fix a crash when the video subsystem quits, if SDL_M...

libsdl.org revision control commits-owner at libsdl.org
Sun Sep 30 07:27:00 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/0a1710b7c321
changeset: 12266:0a1710b7c321
user:      Alex Szpakowski <slime73 at gmail.com>
date:      Sun Sep 30 11:26:41 2018 -0300
description:
macOS: Fix a crash when the video subsystem quits, if SDL_MAC_NO_SANDBOX was defined when SDL was compiled.

diffstat:

 src/video/cocoa/SDL_cocoamousetap.m |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r dfa5cea01a56 -r 0a1710b7c321 src/video/cocoa/SDL_cocoamousetap.m
--- a/src/video/cocoa/SDL_cocoamousetap.m	Sat Sep 29 16:48:15 2018 -0400
+++ b/src/video/cocoa/SDL_cocoamousetap.m	Sun Sep 30 11:26:41 2018 -0300
@@ -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


More information about the commits mailing list