Workaround crash in reportAdditionalMemoryCost other platforms

This commit is contained in:
Anthony J. Thibault 2019-06-04 08:56:07 -07:00
parent 154fd393ba
commit e1534b34b4
2 changed files with 6 additions and 1 deletions

View file

@ -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);

View file

@ -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
}
}