mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 21:35:04 +02:00
Fix recursive invokes of ResourceCache::prefetch
This commit is contained in:
parent
4df417e756
commit
069065dc23
2 changed files with 7 additions and 7 deletions
|
@ -162,7 +162,8 @@ ScriptableResource* ResourceCache::prefetch(const QUrl& url, void* extra) {
|
|||
if (QThread::currentThread() != thread()) {
|
||||
// Must be called in thread to ensure getResource returns a valid pointer
|
||||
QMetaObject::invokeMethod(this, "prefetch", Qt::BlockingQueuedConnection,
|
||||
Q_RETURN_ARG(ScriptableResource*, result), Q_ARG(QUrl, url));
|
||||
Q_RETURN_ARG(ScriptableResource*, result),
|
||||
Q_ARG(QUrl, url), Q_ARG(void*, extra));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,6 +168,11 @@ public slots:
|
|||
protected slots:
|
||||
void updateTotalSize(const qint64& deltaSize);
|
||||
|
||||
// Prefetches a resource to be held by the QScriptEngine.
|
||||
// Left as a protected member so subclasses can overload prefetch
|
||||
// and delegate to it (see TextureCache::prefetch(const QUrl&, int).
|
||||
ScriptableResource* prefetch(const QUrl& url, void* extra);
|
||||
|
||||
private slots:
|
||||
void clearATPAssets();
|
||||
|
||||
|
@ -178,12 +183,6 @@ protected:
|
|||
// the QScriptEngine will delete the pointer when it is garbage collected.
|
||||
Q_INVOKABLE ScriptableResource* prefetch(const QUrl& url) { return prefetch(url, nullptr); }
|
||||
|
||||
|
||||
// Prefetches a resource to be held by the QScriptEngine.
|
||||
// Left as a protected member so subclasses can overload prefetch
|
||||
// and delegate to it (see TextureCache::prefetch(const QUrl&, int).
|
||||
ScriptableResource* prefetch(const QUrl& url, void* extra);
|
||||
|
||||
/// Loads a resource from the specified URL.
|
||||
/// \param fallback a fallback URL to load if the desired one is unavailable
|
||||
/// \param delayLoad if true, don't load the resource immediately; wait until load is first requested
|
||||
|
|
Loading…
Reference in a new issue