Fix uninitialized thread pointer in wxMSW wxJoystick

Initialize m_thread to null to ensure we don't dereference an invalid
pointer later if no joystick with the specified index was found.

Closes https://github.com/wxWidgets/wxWidgets/pull/1663
This commit is contained in:
Stepan Hrbek
2019-11-28 14:17:11 +01:00
committed by Vadim Zeitlin
parent 632363775d
commit 4340841565

View File

@@ -157,6 +157,7 @@ wxJoystick::wxJoystick(int joystick)
JOYINFO joyInfo;
int i, maxsticks;
m_thread = NULL;
maxsticks = joyGetNumDevs();
for( i=0; i<maxsticks; i++ )
{