This repository was archived by the owner on Sep 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,10 @@ void ControllerInput::CloseController() noexcept
4040 isConnected = false ;
4141 if (haptic) {
4242 SDL_HapticClose (haptic);
43- haptic = 0 ;
43+ haptic = nullptr ;
4444 }
4545 SDL_GameControllerClose (gamepad);
46- gamepad = 0 ;
46+ gamepad = nullptr ;
4747 }
4848}
4949
@@ -119,4 +119,11 @@ void ControllerInput::UpdateControllers() noexcept
119119 controller.Update ();
120120 }
121121 }
122+ }
123+
124+ void ControllerInput::Shutdown () noexcept
125+ {
126+ for (auto & controller : Controllers) {
127+ controller.CloseController ();
128+ }
122129}
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class ControllerInput {
2828
2929 void Init () noexcept ;
3030 void Update () noexcept ;
31+ void Shutdown () noexcept ;
3132
3233 static void UpdateControllers () noexcept ;
3334
Original file line number Diff line number Diff line change @@ -1713,6 +1713,7 @@ void OpenFunscripter::Shutdown() noexcept
17131713 OFS_FileLogger::Shutdown ();
17141714 webApi->Shutdown ();
17151715
1716+ controllerInput->Shutdown ();
17161717 SDL_GL_DeleteContext (glContext);
17171718 SDL_DestroyWindow (window);
17181719 SDL_Quit ();
You can’t perform that action at this time.
0 commit comments