mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:47:11 +02:00
avoid shutdown crash
This commit is contained in:
parent
ecb34450bd
commit
6ca9ab6fba
1 changed files with 4 additions and 0 deletions
|
@ -557,6 +557,10 @@ using ScriptableResourceRawPtr = ScriptableResource*;
|
||||||
|
|
||||||
static QScriptValue scriptableResourceToScriptValue(QScriptEngine* engine,
|
static QScriptValue scriptableResourceToScriptValue(QScriptEngine* engine,
|
||||||
const ScriptableResourceRawPtr& resource) {
|
const ScriptableResourceRawPtr& resource) {
|
||||||
|
if (!resource) {
|
||||||
|
return QScriptValue(); // probably shutting down
|
||||||
|
}
|
||||||
|
|
||||||
// The first script to encounter this resource will track its memory.
|
// The first script to encounter this resource will track its memory.
|
||||||
// In this way, it will be more likely to GC.
|
// In this way, it will be more likely to GC.
|
||||||
// This fails in the case that the resource is used across many scripts, but
|
// This fails in the case that the resource is used across many scripts, but
|
||||||
|
|
Loading…
Reference in a new issue