mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 04:07:11 +02:00
ModelCache: reset thread priority back to normal
Based on PR feedback on https://github.com/highfidelity/hifi/pull/7550
This commit is contained in:
parent
f93d114730
commit
d1898eeac6
1 changed files with 4 additions and 2 deletions
|
@ -10,6 +10,7 @@
|
|||
//
|
||||
|
||||
#include "ModelCache.h"
|
||||
#include <Finally.h>
|
||||
#include <FSTReader.h>
|
||||
#include "FBXReader.h"
|
||||
#include "OBJReader.h"
|
||||
|
@ -117,6 +118,9 @@ void GeometryReader::run() {
|
|||
originalPriority = QThread::NormalPriority;
|
||||
}
|
||||
QThread::currentThread()->setPriority(QThread::LowPriority);
|
||||
Finally setPriorityBackToNormal([originalPriority]() {
|
||||
QThread::currentThread()->setPriority(originalPriority);
|
||||
});
|
||||
|
||||
if (!_resource.data()) {
|
||||
qCWarning(modelnetworking) << "Abandoning load of" << _url << "; resource was deleted";
|
||||
|
@ -167,8 +171,6 @@ void GeometryReader::run() {
|
|||
QMetaObject::invokeMethod(resource.data(), "finishedLoading", Qt::BlockingQueuedConnection, Q_ARG(bool, false));
|
||||
}
|
||||
}
|
||||
|
||||
QThread::currentThread()->setPriority(originalPriority);
|
||||
}
|
||||
|
||||
class GeometryDefinitionResource : public GeometryResource {
|
||||
|
|
Loading…
Reference in a new issue