Skip to content

Commit 54c0239

Browse files
committed
Call IN_ShutdownJoystick in non-pedantic shutdown
Just to avoid a printf from SDL.
1 parent d2a30a8 commit 54c0239

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

src/engine/client/cl_main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,6 +2444,10 @@ void CL_Shutdown()
24442444
CL_SendDisconnect();
24452445
CL_StopRecord();
24462446
StopVideo();
2447+
2448+
// Just to avoid the SDL nag message "Leaked SDL_Gamepad (0x123456)" making us look bad
2449+
IN_ShutdownJoystick();
2450+
24472451
// TODO: call DL_StopDownload when deleting the temp file is implemented
24482452
return;
24492453
}

src/engine/null/null_input.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ void IN_Shutdown()
5050
{
5151
}
5252

53+
void IN_ShutdownJoystick()
54+
{
55+
}
56+
5357
void IN_CenterMouse()
5458
{
5559
}

src/engine/qcommon/qcommon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ void IN_Frame();
452452
void IN_FrameEnd();
453453
void IN_Restart();
454454
void IN_Shutdown();
455+
void IN_ShutdownJoystick();
455456
bool IN_IsNumLockOn();
456457
void IN_DropInputsForFrame();
457458
void IN_CenterMouse();

src/engine/sys/sdl_input.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ static void IN_InitJoystick()
660660
IN_ShutdownJoystick
661661
===============
662662
*/
663-
static void IN_ShutdownJoystick()
663+
void IN_ShutdownJoystick()
664664
{
665665
if ( gamepad )
666666
{

0 commit comments

Comments
 (0)