瀏覽代碼

Fixed bug 3512 - Memory leak of SDL_Joystick axes_zero array

Benjamin Harris

Found with valgrind and confirmed in the 2.0.5 source code.
One-line fix in SDL_JoystickClose?
Sam Lantinga 9 年之前
父節點
當前提交
3b18c796ed
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/joystick/SDL_joystick.c

+ 1 - 0
src/joystick/SDL_joystick.c

@@ -486,6 +486,7 @@ SDL_JoystickClose(SDL_Joystick * joystick)
 
     /* Free the data associated with this joystick */
     SDL_free(joystick->axes);
+    SDL_free(joystick->axes_zero);
     SDL_free(joystick->hats);
     SDL_free(joystick->balls);
     SDL_free(joystick->buttons);