aboutsummaryrefslogtreecommitdiffstats
path: root/gpgme/kdpipeiodevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gpgme/kdpipeiodevice.cpp')
-rw-r--r--gpgme/kdpipeiodevice.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/gpgme/kdpipeiodevice.cpp b/gpgme/kdpipeiodevice.cpp
index 9e0179c9..dd2503bd 100644
--- a/gpgme/kdpipeiodevice.cpp
+++ b/gpgme/kdpipeiodevice.cpp
@@ -329,11 +329,14 @@ void KDPipeIODevice::Private::emitReadyRead()
emit q->readyRead();
if ( !thisPointer )
- return;
- qDebug( "KDPipeIODevice::Private::emitReadyRead %p, %d: locking reader (CONSUMER THREAD)", this, counter );
- synchronized( reader ) {
- qDebug( "KDPipeIODevice::Private::emitReadyRead %p, %d: locked reader (CONSUMER THREAD)", this, counter );
- reader->readyReadSentCondition.wakeAll();
+ return;
+
+ if ( reader ) {
+ qDebug( "KDPipeIODevice::Private::emitReadyRead %p, %d: locking reader (CONSUMER THREAD)", this, counter );
+ synchronized( reader ) {
+ qDebug( "KDPipeIODevice::Private::emitReadyRead %p, %d: locked reader (CONSUMER THREAD)", this, counter );
+ reader->readyReadSentCondition.wakeAll();
+ }
}
qDebug( "KDPipeIODevice::Private::emitReadyRead %p leaving %d", this, counter );
@@ -704,7 +707,7 @@ void Reader::run() {
while ( !cancel && !error && bufferFull() ) {
notifyReadyRead();
- if ( bufferFull() ) {
+ if ( !cancel && bufferFull() ) {
qDebug( "%p: Reader::run: buffer is full, going to sleep", this );
bufferNotFullCondition.wait( &mutex );
}