2008-01-10 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Thu, 10 Jan 2008 13:38:34 +0000 (13:38 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Thu, 10 Jan 2008 13:38:34 +0000 (13:38 +0000)
* kdpipeiodevice.cpp: New version from Frank Osterfeld.

gpgme/ChangeLog
gpgme/kdpipeiodevice.cpp

index 9f5bbe604179c9c1489628ee702911f72a3a9cbb..60b4e50347d790ea968baa656d3865ec5de35f8f 100644 (file)
@@ -1,5 +1,7 @@
 2008-01-10  Marcus Brinkmann  <marcus@g10code.de>
 
+       * kdpipeiodevice.cpp: New version from Frank Osterfeld.
+
        * engine-gpgconf.c (gpgconf_config_load_cb2): Handle the flag
        NO_ARG_DESC.
 
index 9e0179c92a3aeeb55f0ffa0d1b52ce02840c968c..dd2503bd0fc5124e85c7f155c553938f4f00c0bf 100644 (file)
@@ -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 );
            }