author David Ludwig <>
Tue, 17 Mar 2020 17:34:24 -0400
changeset 13646 784ce9766fb9
parent 10722 30e271a26a02
permissions -rwxr-xr-x
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.
     1 #!/bin/sh
     2 #
     3 echo "Generating build information using autoconf"
     4 echo "This may take a while ..."
     6 srcdir=`dirname $0`
     7 test -z "$srcdir" && srcdir=.
     8 cd "$srcdir"
    10 # Regenerate configuration files
    11 cat acinclude/* >aclocal.m4
    12 found=false
    13 for autoconf in autoconf autoconf259 autoconf-2.59
    14 do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
    15 done
    16 if test x$found = xfalse; then
    17     echo "Couldn't find autoconf, aborting"
    18     exit 1
    19 fi
    20 (cd test; sh
    22 # Run configure for this platform
    23 echo "Now you are ready to run ./configure"