mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Make sure we call allReferencesCleared on the right thread.
This commit is contained in:
parent
197ce036c4
commit
58b063ee12
2 changed files with 6 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <cfloat>
|
||||
#include <cmath>
|
||||
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include <QtDebug>
|
||||
|
||||
|
@ -174,6 +175,10 @@ float Resource::getLoadPriority() {
|
|||
}
|
||||
|
||||
void Resource::allReferencesCleared() {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "allReferencesCleared");
|
||||
return;
|
||||
}
|
||||
if (_cache) {
|
||||
// create and reinsert new shared pointer
|
||||
QSharedPointer<Resource> self(this, &Resource::allReferencesCleared);
|
||||
|
|
|
@ -123,7 +123,7 @@ public:
|
|||
|
||||
void setCache(ResourceCache* cache) { _cache = cache; }
|
||||
|
||||
void allReferencesCleared();
|
||||
Q_INVOKABLE void allReferencesCleared();
|
||||
|
||||
protected slots:
|
||||
|
||||
|
|
Loading…
Reference in a new issue