qt: Avoid crashes on X11 at exit

This commit is contained in:
Cacodemon345
2022-02-17 11:45:42 +06:00
parent 4f9af2eb77
commit be3501cfe1
2 changed files with 10 additions and 3 deletions

View File

@@ -445,6 +445,10 @@ void MainWindow::closeEvent(QCloseEvent *event) {
} }
qt_nvr_save(); qt_nvr_save();
config_save(); config_save();
#ifdef __unix__
extern void xinput2_exit();
if (QApplication::platformName() == "xcb") xinput2_exit();
#endif
event->accept(); event->accept();
} }

View File

@@ -152,9 +152,12 @@ void xinput2_proc()
void xinput2_exit() void xinput2_exit()
{ {
exitthread = true; if (!exitthread)
procThread->wait(5000); {
procThread->terminate(); exitthread = true;
procThread->wait(5000);
procThread->terminate();
}
} }
void xinput2_init() void xinput2_init()