diff options
Diffstat (limited to 'tools/v4/main.cpp')
-rw-r--r-- | tools/v4/main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/v4/main.cpp b/tools/v4/main.cpp index 69090c7e2c..14b08d3282 100644 --- a/tools/v4/main.cpp +++ b/tools/v4/main.cpp @@ -218,11 +218,13 @@ int main(int argc, char *argv[]) QV4::Script script(ctx, code, fn); script.parseAsBinding = runAsQml; script.parse(); + script.function()->compilationUnit->ref(); QV4::Value result = script.run(); if (!result.isUndefined()) { if (! qgetenv("SHOW_EXIT_VALUE").isEmpty()) std::cout << "exit value: " << qPrintable(result.toString(ctx)->toQString()) << std::endl; } + script.function()->compilationUnit->deref(); } catch (QV4::Exception& ex) { ex.accept(ctx); showException(ctx, ex); |