aboutsummaryrefslogtreecommitdiffstats
path: root/tools/v4/main.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-08-16 17:25:58 +0200
committerLars Knoll <lars.knoll@digia.com>2013-08-16 19:18:48 +0200
commit0f0e7443aea0d9a203b380bec708c485a01450e0 (patch)
treec34a687f99964d9d97c535e6c3cf1fdc232aaebf /tools/v4/main.cpp
parentbb8d91829c12b7742205eb96a0e8fbcc164c5e91 (diff)
Refcount the compilation unit and remove refcount from runtime function
Change-Id: Iaa2f96a6814f1b39589ffcfe3c84e3c229e25f1f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tools/v4/main.cpp')
-rw-r--r--tools/v4/main.cpp2
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);