gtk: Initialize jd

This commit is contained in:
BearOso 2022-02-19 13:22:20 -06:00
parent 17e75b1469
commit 8f5afb1013
1 changed files with 2 additions and 1 deletions

View File

@ -812,7 +812,7 @@ void JoyDevices::set_mode(int mode)
void JoyDevices::poll_events() void JoyDevices::poll_events()
{ {
SDL_Event event; SDL_Event event;
JoyDevice *jd; JoyDevice *jd{};
while (SDL_PollEvent(&event)) while (SDL_PollEvent(&event))
{ {
@ -834,6 +834,7 @@ void JoyDevices::poll_events()
remove(event.jdevice.which); remove(event.jdevice.which);
continue; continue;
} }
if (jd) if (jd)
{ {
jd->handle_event(&event); jd->handle_event(&event);