aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4executablecompilationunit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4executablecompilationunit.cpp')
-rw-r--r--src/qml/jsruntime/qv4executablecompilationunit.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp
index 403b81b2b4..9e10e437a8 100644
--- a/src/qml/jsruntime/qv4executablecompilationunit.cpp
+++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp
@@ -82,12 +82,7 @@ void ExecutableCompilationUnit::populate()
gc starts marking the root set at the start of a run.
*/
const CompiledData::Unit *data = m_compilationUnit->data;
- auto oldState = std::exchange(engine->memoryManager->gcBlocked, MemoryManager::InCriticalSection);
- auto cleanup = qScopeGuard([this, oldState]() {
- engine->memoryManager->gcBlocked = oldState;
- if (oldState != MemoryManager::Unblocked)
- this->markObjects(engine->memoryManager->markStack());
- });
+ GCCriticalSection<ExecutableCompilationUnit> criticalSection(engine, this);
Q_ASSERT(!runtimeStrings);
Q_ASSERT(engine);