summaryrefslogtreecommitdiffstats
path: root/smdirwatcher.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-07-29 10:08:33 +0200
committerArno <am@disconnect.de>2013-07-29 10:08:33 +0200
commit06cfadc8386aec27b9c7c43486fc0b057e9fb022 (patch)
treeca0343db7f3363fb35bd4fc0ea72779651e0361e /smdirwatcher.cpp
parent28c7436a71910aabcc37945255fb577f7a032f0d (diff)
downloadSheMov-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.cpp1
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();