try to fix hang on exit by keyboard
This commit is contained in:
@@ -542,6 +542,10 @@ void PIKbdListener::readKeyboard() {
|
|||||||
|
|
||||||
void PIKbdListener::stop() {
|
void PIKbdListener::stop() {
|
||||||
PIThread::stop();
|
PIThread::stop();
|
||||||
|
#ifndef WINDOWS
|
||||||
|
char c = '\n';
|
||||||
|
write(0, &c, 1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,10 +29,13 @@
|
|||||||
#include "pithread.h"
|
#include "pithread.h"
|
||||||
#include "pitime.h"
|
#include "pitime.h"
|
||||||
|
|
||||||
#define WAIT_FOR_EXIT \
|
#define WAIT_FOR_EXIT \
|
||||||
while (!PIKbdListener::exiting) \
|
while (!PIKbdListener::exiting) \
|
||||||
piMSleep(PIP_MIN_MSLEEP * 5); \
|
piMSleep(PIP_MIN_MSLEEP * 5); \
|
||||||
if (PIKbdListener::instance()) PIKbdListener::instance()->stopAndWait();
|
if (PIKbdListener::instance()) { \
|
||||||
|
PIKbdListener::instance()->stop(); \
|
||||||
|
PIKbdListener::instance()->waitForFinish(); \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class PIP_EXPORT PIKbdListener: public PIThread {
|
class PIP_EXPORT PIKbdListener: public PIThread {
|
||||||
|
|||||||
Reference in New Issue
Block a user