made caller/concurrent rules tighter
This commit is contained in:
@@ -50,7 +50,11 @@ NetworkRequest NetworkRequest::type(NetworkRequestType newRequestType) &&
|
||||
|
||||
NetworkRequest NetworkRequest::caller(const QObject *caller) &&
|
||||
{
|
||||
this->data->caller_ = caller;
|
||||
// Caller must be in gui thread
|
||||
assert(caller->thread() == qApp->thread());
|
||||
|
||||
this->data->caller_ = const_cast<QObject *>(caller);
|
||||
this->data->hasCaller_ = true;
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
@@ -144,6 +148,9 @@ void NetworkRequest::execute()
|
||||
this->data->useQuickLoadCache_ = false;
|
||||
}
|
||||
|
||||
// Can not have a caller and be concurrent at the same time.
|
||||
assert(!(this->data->caller_ && this->data->executeConcurrently));
|
||||
|
||||
load(std::move(this->data));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user