mirror of
https://github.com/AntiMicroX/antimicrox.git
synced 2025-12-23 23:29:25 -05:00
fix: joystickstatuswindow: defer deletion of window upon close (#1229)
Defer deleting the window when it's closed until after the main loop has run. This prevents a segfault when the window is closed for controllers with accelerometers and gyroscopes, such as DualSense controllers. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
@@ -302,6 +302,8 @@ JoystickStatusWindow::JoystickStatusWindow(InputDevice *joystick, QWidget *paren
|
||||
connect(this, &JoystickStatusWindow::finished, this, &JoystickStatusWindow::restoreButtonStates);
|
||||
}
|
||||
|
||||
void JoystickStatusWindow::reject() { this->deleteLater(); }
|
||||
|
||||
JoystickStatusWindow::~JoystickStatusWindow() { delete ui; }
|
||||
|
||||
void JoystickStatusWindow::restoreButtonStates(int code)
|
||||
|
||||
@@ -44,6 +44,7 @@ class JoystickStatusWindow : public QDialog
|
||||
InputDevice *getJoystick() const;
|
||||
|
||||
private:
|
||||
void reject();
|
||||
Ui::JoystickStatusWindow *ui;
|
||||
|
||||
InputDevice *joystick;
|
||||
|
||||
Reference in New Issue
Block a user