Skip to content

Commit 8218fab

Browse files
MarkOatesSiegeLord
authored andcommitted
Only release devices when not NULL (fix crash on no devices)
1 parent c9c9455 commit 8218fab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/macosx/hidjoy.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ static int enumerate_and_create_initial_joystick_devices(IOHIDManagerRef manager
358358
add_joystick_device(dev, false);
359359
num_joysticks_enumerated++;
360360
}
361-
}
362361

363-
CFRelease(devices);
362+
CFRelease(devices);
363+
}
364364

365365
return num_joysticks_enumerated;
366366
}

0 commit comments

Comments
 (0)