fixed deleting QTimer on wrong thread

This commit is contained in:
fourtf
2019-08-20 23:30:39 +02:00
parent 14222f84f2
commit 7643c0d20d
16 changed files with 64 additions and 59 deletions
+8 -5
View File
@@ -50,11 +50,14 @@ NetworkRequest NetworkRequest::type(NetworkRequestType newRequestType) &&
NetworkRequest NetworkRequest::caller(const QObject *caller) &&
{
// Caller must be in gui thread
assert(caller->thread() == qApp->thread());
if (caller)
{
// Caller must be in gui thread
assert(caller->thread() == qApp->thread());
this->data->caller_ = const_cast<QObject *>(caller);
this->data->hasCaller_ = true;
this->data->caller_ = const_cast<QObject *>(caller);
this->data->hasCaller_ = true;
}
return std::move(*this);
}
@@ -100,7 +103,7 @@ NetworkRequest NetworkRequest::header(const char *headerName,
NetworkRequest NetworkRequest::timeout(int ms) &&
{
this->data->hasTimeout_ = true;
this->data->timer_.setInterval(ms);
this->data->timer_->setInterval(ms);
return std::move(*this);
}