mirror of
https://github.com/overte-org/overte.git
synced 2025-04-07 15:34:05 +02:00
Workaround crash in reportAdditionalMemoryCost other platforms
This commit is contained in:
parent
154fd393ba
commit
e1534b34b4
2 changed files with 6 additions and 1 deletions
|
@ -76,8 +76,10 @@ QScriptValue ArrayBufferClass::newInstance(qint32 size) {
|
|||
engine()->evaluate("throw \"ArgumentError: absurd length\"");
|
||||
return QScriptValue();
|
||||
}
|
||||
|
||||
// We've patched qt to fix https://highfidelity.atlassian.net/browse/BUGZ-46 on mac and windows only.
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||
engine()->reportAdditionalMemoryCost(size);
|
||||
#endif
|
||||
QScriptEngine* eng = engine();
|
||||
QVariant variant = QVariant::fromValue(QByteArray(size, 0));
|
||||
QScriptValue data = eng->newVariant(variant);
|
||||
|
|
|
@ -1346,7 +1346,10 @@ void ScriptEngine::callAnimationStateHandler(QScriptValue callback, AnimVariantM
|
|||
|
||||
void ScriptEngine::updateMemoryCost(const qint64& deltaSize) {
|
||||
if (deltaSize > 0) {
|
||||
// We've patched qt to fix https://highfidelity.atlassian.net/browse/BUGZ-46 on mac and windows only.
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||
reportAdditionalMemoryCost(deltaSize);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue