Fix crash if selected settings window does not open
commit88160be5206cbe7419adfc82893c332c8c0de0ae
authorIlari Liusvaara <ilariliusvaara@welho.com>
Mon, 24 Jun 2019 19:16:15 +0000 (24 22:16 +0300)
committerIlari Liusvaara <ilariliusvaara@welho.com>
Mon, 24 Jun 2019 19:16:15 +0000 (24 22:16 +0300)
treeae317802efeb2326d9e11c7ff513b94c5fad071a
parentd4003f9d6c63889507aa221fbc7719a4ebae5da1
Fix crash if selected settings window does not open

If one tries to open a setting window, the emulator grabs the input.
However, if opening the window then fails (most commonly because it is
joystick settings window, and there are no online nor offline gamepads)
the grab needs to be undone because otherwise the grab will point to
freed memory. The destructor would undo it, except failure to open window
triggers exit from constructor by exception, in which case destructor
will not run.

Bug reported on IRC.
src/platform/wxwidgets/settings-common.cpp