From 06cfadc8386aec27b9c7c43486fc0b057e9fb022 Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 29 Jul 2013 10:08:33 +0200 Subject: 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. --- smdirwatcher.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'smdirwatcher.cpp') 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(); -- cgit v1.2.3-70-g09d2