aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlengine_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-04-08 10:45:22 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-04-08 10:45:53 +0200
commit1aa83ca46cf1ffebc5a486a0185dcf6313bca26b (patch)
tree1a8db2d1ab871315324bb72ab1f4afdbb45f0a21 /src/qml/qml/qqmlengine_p.h
parenta28ebf1e0a8b0c30fb1b8062bd7e035cc0429476 (diff)
parenta889bcb6c3c66a616e73fa5ed3c9d900d7c7d6f5 (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Diffstat (limited to 'src/qml/qml/qqmlengine_p.h')
-rw-r--r--src/qml/qml/qqmlengine_p.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h
index 795a505742..92eadb0540 100644
--- a/src/qml/qml/qqmlengine_p.h
+++ b/src/qml/qml/qqmlengine_p.h
@@ -269,6 +269,16 @@ private:
void doDeleteInEngineThread();
};
+/*
+ This function should be called prior to evaluation of any js expression,
+ so that scarce resources are not freed prematurely (eg, if there is a
+ nested javascript expression).
+ */
+inline void QQmlEnginePrivate::referenceScarceResources()
+{
+ scarceResourcesRefCount += 1;
+}
+
/*!
Returns true if the calling thread is the QQmlEngine thread.
*/