فهرست منبع

Fix refcounting in SDL_hid_exit

Mathieu Eyraud 3 سال پیش
والد
کامیت
5fc7a90a8b
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/hidapi/SDL_hidapi.c

+ 1 - 1
src/hidapi/SDL_hidapi.c

@@ -1084,8 +1084,8 @@ int SDL_hid_exit(void)
     if (SDL_hidapi_refcount == 0) {
         return 0;
     }
+    --SDL_hidapi_refcount;
     if (SDL_hidapi_refcount > 0) {
-        --SDL_hidapi_refcount;
         return 0;
     }
     SDL_hidapi_refcount = 0;