aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-08-12 13:30:19 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-12 22:14:49 +0200
commit12520389e91b73b47fb2006b7c7623285c9450c5 (patch)
tree2b195ab1d2e8c6dfee0deee42c870ac71ef34abf /src/qml/compiler/qv4codegen.cpp
parent5ef37477f99ed97dd6669f05a0ee555fc3baf2ca (diff)
Fix leak of QString in V4 IR
The destructors of the IR nodes won't be called because they come out of a memory pool. Therefore we must store strings by pointer from the function's string pool. Change-Id: I841e801b81c871e8d08cf63ee1e053744c0bf4dc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index d0c43c8f56..969b35831e 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -2389,7 +2389,7 @@ bool Codegen::visit(TryStatement *ast)
int exception_to_rethrow = _block->newTemp();
_block->TRY(tryBody, catchBody,
- ast->catchExpression ? ast->catchExpression->name.toString() : QString(),
+ _function->newString(ast->catchExpression ? ast->catchExpression->name.toString() : QString()),
_block->TEMP(exception_to_rethrow));
_block = tryBody;