, mBusy(false)
 {
     setObjectName(QString("%1.Worker").arg(VER_MODULE_NAME_STR));
+
+    EVAF_INFO("%s created", qPrintable(objectName()));
+}
+
+Internal::Worker::~Worker()
+{
+    EVAF_INFO("%s destroyed", qPrintable(objectName()));
 }
 
 void Internal::Worker::cancel()
     forever {
         QMutexLocker lock(&mLock);
 
+        if (mDoTerminate)
+            break;
+
         mSomethingToDo.wait(&mLock);
 
         if (mDoTerminate)
 
             lock.relock();
             mBusy = false;
+            bool c = mDoCancel;
+            lock.unlock();
 
-            emit finished(mDoCancel);
+            emit finished(c);
         }
     }
 }
         {
             QMutexLocker l(&mLock);
             if (mDoCancel)
-                break;
+                return;
         }
 
         // Check for the file name to match the include filter and not the exclude filter
             QByteArray buf;
             while (!f.atEnd() && (includeFilterMatched <= 0 || excludeFilterMatched <= 0)) {
 
+                // Check for the cancel flag
+                {
+                    QMutexLocker l(&mLock);
+                    if (mDoCancel)
+                        return;
+                }
+
                 /* We read ReadBufferSize bytes from the file and append to the buffer.
                  * We keep max 2 x ReadBufferSize bytes in the buffer and throw away the oldest
                  * ReadBufferSize bytes of data. Every block is checked twice, but we make sure that
             {
                 QMutexLocker l(&mLock);
                 if (mDoCancel)
-                    break;
+                    return;
             }
 
             recursiveSearch(l + directory);
 
 /**
  * Module/library version number in the form major,minor,release,build
  */
-#define VER_FILE_VERSION                0,1,1,1
+#define VER_FILE_VERSION                0,1,2,2
 
 /**
  * Module/library version number in the string format (shall end with \0)
  */
-#define VER_FILE_VERSION_STR            "0.1.1.1\0"
+#define VER_FILE_VERSION_STR            "0.1.2.2\0"
 
 /**
  * Module/library name (shall end with \0)