From 9cd2e9ec8fc0127393dfce9c0359d500c8c238be Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Tue, 09 Apr 2019 02:22:50 +0000
Subject: [PATCH] updae source to 2.0.9 source

---
 source/src/video/cocoa/SDL_cocoamousetap.m |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/source/src/video/cocoa/SDL_cocoamousetap.m b/source/src/video/cocoa/SDL_cocoamousetap.m
index 3c4fcf2..aa4f152 100644
--- a/source/src/video/cocoa/SDL_cocoamousetap.m
+++ b/source/src/video/cocoa/SDL_cocoamousetap.m
@@ -211,7 +211,7 @@
             tapdata->thread = SDL_CreateThreadInternal(&Cocoa_MouseTapThread, "Event Tap Loop", 512 * 1024, tapdata);
             if (tapdata->thread) {
                 /* Success - early out. Ownership transferred to thread. */
-            	return;
+                return;
             }
             CFRelease(tapdata->tap);
         }
@@ -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

--
Gitblit v1.9.3