try to fix hang on exit by keyboard
This commit is contained in:
@@ -542,6 +542,10 @@ void PIKbdListener::readKeyboard() {
|
||||
|
||||
void PIKbdListener::stop() {
|
||||
PIThread::stop();
|
||||
#ifndef WINDOWS
|
||||
char c = '\n';
|
||||
write(0, &c, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user