Mac and Linux SDL2 binary snapshots
Edward Rudd
2020-05-02 03f8528315fa46c95991a34f3325d7b33ae5538c
source/src/sensor/SDL_sensor.c
@@ -1,6 +1,6 @@
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
  Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
@@ -486,7 +486,7 @@
    /* Post the event, if desired */
    posted = 0;
#if !SDL_EVENTS_DISABLED
    if (SDL_GetEventState(SDL_JOYAXISMOTION) == SDL_ENABLE) {
    if (SDL_GetEventState(SDL_SENSORUPDATE) == SDL_ENABLE) {
        SDL_Event event;
        event.type = SDL_SENSORUPDATE;
        event.sensor.which = sensor->instance_id;
@@ -503,7 +503,11 @@
SDL_SensorUpdate(void)
{
    int i;
    SDL_Sensor *sensor;
    SDL_Sensor *sensor, *next;
    if (!SDL_WasInit(SDL_INIT_SENSOR)) {
        return;
    }
    SDL_LockSensors();
@@ -527,7 +531,8 @@
    SDL_updating_sensor = SDL_FALSE;
    /* If any sensors were closed while updating, free them here */
    for (sensor = SDL_sensors; sensor; sensor = sensor->next) {
    for (sensor = SDL_sensors; sensor; sensor = next) {
        next = sensor->next;
        if (sensor->ref_count <= 0) {
            SDL_SensorClose(sensor);
        }