diff options
author | Arno <am@disconnect.de> | 2013-07-29 10:08:33 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-07-29 10:08:33 +0200 |
commit | 06cfadc8386aec27b9c7c43486fc0b057e9fb022 (patch) | |
tree | ca0343db7f3363fb35bd4fc0ea72779651e0361e /smdirwatcher.cpp | |
parent | 28c7436a71910aabcc37945255fb577f7a032f0d (diff) | |
download | SheMov-06cfadc8386aec27b9c7c43486fc0b057e9fb022.tar.gz SheMov-06cfadc8386aec27b9c7c43486fc0b057e9fb022.tar.bz2 SheMov-06cfadc8386aec27b9c7c43486fc0b057e9fb022.zip |
Prevent datacollector from running when operating on files
This stuff was racy from the beginning. It could happen that the model
got reset after we fetched the selected indexes. Add a mutex and lock it
before operating on the file view. Hopefully this will many, if not all
random crashes.
Diffstat (limited to 'smdirwatcher.cpp')
-rw-r--r-- | smdirwatcher.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/smdirwatcher.cpp b/smdirwatcher.cpp index 371e7cf..83e0efa 100644 --- a/smdirwatcher.cpp +++ b/smdirwatcher.cpp @@ -118,6 +118,7 @@ void SmDataColletor::setCheckForPresent(bool present){ void SmDataColletor::run(){ forever { + QMutexLocker l(&mHoldMx); mSemUsed->acquire(); if(mCancel){ QSqlDatabase::database("collectordb").close(); |