mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 15:59:49 +02:00
Fix for crash on deleting caches
This commit is contained in:
parent
adee1aeadf
commit
95834a36f7
4 changed files with 11 additions and 1 deletions
|
@ -6039,7 +6039,8 @@ void Application::reloadResourceCaches() {
|
||||||
getEntities()->clear();
|
getEntities()->clear();
|
||||||
|
|
||||||
DependencyManager::get<AssetClient>()->clearCache();
|
DependencyManager::get<AssetClient>()->clearCache();
|
||||||
DependencyManager::get<ScriptCache>()->clearCache();
|
//It's already cleared in reloadAllScripts so I'm not sure this is necessary.
|
||||||
|
//DependencyManager::get<ScriptCache>()->clearCache();
|
||||||
|
|
||||||
// Clear all the resource caches
|
// Clear all the resource caches
|
||||||
DependencyManager::get<ResourceCacheSharedItems>()->clear();
|
DependencyManager::get<ResourceCacheSharedItems>()->clear();
|
||||||
|
|
|
@ -609,6 +609,7 @@ void ScriptEngines::onScriptFinished(const QString& rawScriptURL, ScriptManagerP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
manager->waitTillDoneRunning();
|
||||||
removeScriptEngine(manager);
|
removeScriptEngine(manager);
|
||||||
|
|
||||||
if (removed && !_isReloading) {
|
if (removed && !_isReloading) {
|
||||||
|
|
|
@ -1032,6 +1032,7 @@ void ScriptManager::stop(bool marshal) {
|
||||||
QMetaObject::invokeMethod(this, "stop");
|
QMetaObject::invokeMethod(this, "stop");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_isFinished) {
|
if (!_isFinished) {
|
||||||
_isFinished = true;
|
_isFinished = true;
|
||||||
emit runningStateChanged();
|
emit runningStateChanged();
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
//
|
//
|
||||||
// Created by Heather Anderson on 4/25/21.
|
// Created by Heather Anderson on 4/25/21.
|
||||||
// Copyright 2021 Vircadia contributors.
|
// Copyright 2021 Vircadia contributors.
|
||||||
|
// Copyright 2022 Overte e.V.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -22,6 +23,7 @@
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
class ScriptEngine;
|
class ScriptEngine;
|
||||||
class ScriptValue;
|
class ScriptValue;
|
||||||
|
@ -199,6 +201,11 @@ ScriptValue& ScriptValue::operator=(const ScriptValue& other) {
|
||||||
|
|
||||||
ScriptValue ScriptValue::call(const ScriptValue& thisObject, const ScriptValueList& args) const {
|
ScriptValue ScriptValue::call(const ScriptValue& thisObject, const ScriptValueList& args) const {
|
||||||
Q_ASSERT(_proxy != nullptr);
|
Q_ASSERT(_proxy != nullptr);
|
||||||
|
ScriptEnginePointer scriptEngine = _proxy->engine();
|
||||||
|
if (scriptEngine == nullptr) {
|
||||||
|
qDebug() << "Call to deleted or non-existing script engine";
|
||||||
|
return ScriptValue();
|
||||||
|
}
|
||||||
return _proxy->call(thisObject, args);
|
return _proxy->call(thisObject, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue