Compare commits

1 Commits

Author SHA1 Message Date
855d1ca1b5 try to fix hang on exit by keyboard 2024-12-26 16:12:02 +03:00
2 changed files with 11 additions and 4 deletions

View File

@@ -542,6 +542,10 @@ void PIKbdListener::readKeyboard() {
void PIKbdListener::stop() {
PIThread::stop();
#ifndef WINDOWS
char c = '\n';
write(0, &c, 1);
#endif
}

View File

@@ -29,10 +29,13 @@
#include "pithread.h"
#include "pitime.h"
#define WAIT_FOR_EXIT \
while (!PIKbdListener::exiting) \
piMSleep(PIP_MIN_MSLEEP * 5); \
if (PIKbdListener::instance()) PIKbdListener::instance()->stopAndWait();
#define WAIT_FOR_EXIT \
while (!PIKbdListener::exiting) \
piMSleep(PIP_MIN_MSLEEP * 5); \
if (PIKbdListener::instance()) { \
PIKbdListener::instance()->stop(); \
PIKbdListener::instance()->waitForFinish(); \
}
class PIP_EXPORT PIKbdListener: public PIThread {