mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-01 16:41:22 +00:00
Fixed crash in game controller support code
Joystick's startup and shutdown (of Native OS X backend) can be called more than once
This commit is contained in:
parent
4f383e5aa7
commit
0d1c954bc0
1 changed files with 6 additions and 0 deletions
|
@ -739,6 +739,11 @@ IOKitJoystickManager* s_joystickManager;
|
||||||
|
|
||||||
void I_StartupJoysticks()
|
void I_StartupJoysticks()
|
||||||
{
|
{
|
||||||
|
if (NULL != s_joystickManager)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// HID Manager API is available on 10.5 (Darwin 9.x) or newer
|
// HID Manager API is available on 10.5 (Darwin 9.x) or newer
|
||||||
|
|
||||||
if (darwinVersion.major >= 9)
|
if (darwinVersion.major >= 9)
|
||||||
|
@ -750,6 +755,7 @@ void I_StartupJoysticks()
|
||||||
void I_ShutdownJoysticks()
|
void I_ShutdownJoysticks()
|
||||||
{
|
{
|
||||||
delete s_joystickManager;
|
delete s_joystickManager;
|
||||||
|
s_joystickManager = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_GetJoysticks( TArray< IJoystickConfig* >& sticks )
|
void I_GetJoysticks( TArray< IJoystickConfig* >& sticks )
|
||||||
|
|
Loading…
Reference in a new issue