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.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp
index dc24f2d2a9..aed1a84f63 100644
--- a/src/qml/jsruntime/qv4executablecompilationunit.cpp
+++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp
@@ -695,8 +695,10 @@ const Value *ExecutableCompilationUnit::resolveExportRecursively(
return fragment.native;
ScopedObject o(scope, dependentModule.native);
- if (o)
- return engine->registerNativeModule(request, o->get(importName));
+ if (o) {
+ ScopedValue nativeModule(scope, o->get(importName));
+ return engine->registerNativeModule(request, nativeModule);
+ }
return nullptr;
} else {
@@ -727,8 +729,10 @@ const Value *ExecutableCompilationUnit::resolveExportRecursively(
resolution = fragment.native;
} else {
ScopedObject o(scope, dependentModule.native);
- if (o)
- resolution = engine->registerNativeModule(request, o->get(exportName));
+ if (o) {
+ ScopedValue nativeModule(scope, o->get(exportName));
+ resolution = engine->registerNativeModule(request, nativeModule);
+ }
}
}
}