Only refresh engine settings on own thread

This commit is contained in:
Zach Pomerantz 2016-01-23 03:39:09 -08:00 committed by Zach Pomerantz
parent 29f9d15af0
commit e4af8d89f1

View file

@ -9,8 +9,7 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "Task.h"
#include <QtCore/QThread>
#include <qscriptengine.h> // QObject
#include "Context.h"
@ -18,9 +17,15 @@
#include "gpu/Batch.h"
#include <PerfStat.h>
#include "Task.h"
using namespace render;
void TaskConfig::refresh() {
// FIXME: Only configure when on own thread (see RecordingInterface for example)
if (QThread::currentThread() != thread()) {
QMetaObject::invokeMethod(this, "refresh", Qt::BlockingQueuedConnection);
return;
}
_task->configure(*this);
}