summaryrefslogtreecommitdiff
path: root/src/script/api
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2019-10-08 13:49:03 +0200
committerLars Knoll <lars.knoll@qt.io>2019-10-08 14:20:39 +0200
commit97f194cfabf9d8ab186241760a29bae1f4811184 (patch)
tree7d599bd14b34d82d1deee4cf71c4a7c58b8d232c /src/script/api
parent650eb9a1ef17762157b57e740031272980cbeb04 (diff)
downloadqtscript-97f194cfabf9d8ab186241760a29bae1f4811184.tar.gz
Fix crash in QScriptEngine::reportAdditionalMemoryCost
Fixes: QTBUG-76176 Change-Id: Id48e21b7e2617f34e4ae3e9d09e56641d1d1654a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/qscriptengine.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 5bd399f..ec5e1ff 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -1332,8 +1332,10 @@ void QScriptEnginePrivate::collectGarbage()
void QScriptEnginePrivate::reportAdditionalMemoryCost(int size)
{
- if (size > 0)
+ if (size > 0) {
+ QScript::APIShim shim(this);
globalData->heap.reportExtraMemoryCost(size);
+ }
}
QScript::TimeoutCheckerProxy *QScriptEnginePrivate::timeoutChecker() const