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();
config_save();
#ifdef __unix__
extern void xinput2_exit();
if (QApplication::platformName() == "xcb") xinput2_exit();
#endif
event->accept();
}

View File

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