GNOME Bugzilla – Bug 780920
Plugging more than 2 gamepads orderly will always lead to a segmentation fault.
Last modified: 2017-04-07 11:55:47 UTC
Mostly unrecognisable because usually people don't use 2+ gamepads. The bug is in how RetroInputManager handles the ports and gamepads.
Created attachment 349279 [details] [review] retro: Fix seg-fault when plugging many gamepads Fix handling of gamepads array for which keyboard port was going out of bounds.
Adrien: I think RetroInputManager needs a bit of reformat, so many repetitive code blocks! :P Should I patch it up?
Like having only one function handling both 'is_port_plugged' and 'gamepads'? Sounds good to me. :) You can directly do it instead of the previous patch.
Created attachment 349338 [details] [review] retro: Refactor input manager Remove use of is_port_plugged array and introduce input_devices array to handle both gamepads and keyboard together.
Created attachment 349349 [details] [review] retro: Refactor input manager Replace the use of is_port_plugged array and gamepads array with input_devices array. Saving the plugged state of each gamepad is redundant and by using the base class Retro.InputDevice we can handle gamepads and keyboard together to avoid redundancy and errors.
Review of attachment 349349 [details] [review]: It looks ok. And if we need something more complex later (for the gamepad assignment widget) we can modify it later anyway.
Attachment 349349 [details] pushed as bd652b7 - retro: Refactor input manager