Fix thread no-stop bug
This commit is contained in:
@@ -300,3 +300,8 @@ void DeviceManager::processScan(const char* json, bool empty) {
|
||||
THROW_ERROR(errmsg);
|
||||
qDebug() << ">>>>>>>>>>>>>>>>>>>>>ScanControl failed";
|
||||
}
|
||||
|
||||
void DeviceManager::close() {
|
||||
previewDataCaller->terminate();
|
||||
delete previewDataCaller;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public:
|
||||
return &manager;
|
||||
}
|
||||
void initDevice();
|
||||
void close();
|
||||
void setErrorOccurred(bool v){
|
||||
errorOccurred = v;
|
||||
}
|
||||
@@ -35,7 +36,7 @@ private:
|
||||
int deviceInfTimerID = -1;
|
||||
int lastStatus = -1;
|
||||
bool previewing = false;
|
||||
bool endLoop = false;
|
||||
volatile bool endLoop = false;
|
||||
bool errorOccurred = false;
|
||||
QThread* previewDataCaller;
|
||||
};
|
||||
|
||||
@@ -157,8 +157,10 @@ systemSettingForm::systemSettingForm(QWidget* parent) :
|
||||
|
||||
systemSettingForm::~systemSettingForm()
|
||||
{
|
||||
diskInfoCaller->quit();
|
||||
diskInfoCaller->wait();
|
||||
diskInfoCaller->terminate();
|
||||
// diskInfoCaller->quit();
|
||||
// diskInfoCaller->wait();
|
||||
delete diskInfoCaller;
|
||||
}
|
||||
|
||||
void systemSettingForm::updateStorageUsed()
|
||||
|
||||
Reference in New Issue
Block a user