SDL2Config.cmake
author David Ludwig <dludwig@pobox.com>
Tue, 17 Mar 2020 17:34:24 -0400
changeset 13646 784ce9766fb9
parent 11210 c92070a96da5
permissions -rw-r--r--
Fix for Bug 5034 - Replugging in a controller crashes on macOS in SDL 2.0.12

This is a multi-part fix, and is the 2nd attempt at a fix for Bug 5034. Here
are the problems being addressed:

1. On macOS 10.14.x and earlier, trying to call IOHIDDeviceUnscheduleFromRunLoop
without a prior, paired call to IOHIDDeviceScheduleWithRunLoop, appears to
lead to a crash. A per-device flag has been added to make sure that these
calls are paired.
2. DARWIN_JoystickDetect was free'ing its SDL_joystick's hwdata field
(via FreeDevice) without setting it to NULL, and DARWIN_JoystickRumble wasn't
checking for a NULL hwdata. FreeDevice will now set hwdata to NULL and
DARWIN_JoystickRumble will check for a NULL hwdata.
slouken@11210
     1
include("${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")