aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmljs/qmljsinterpreter.cpp
diff options
context:
space:
mode:
authorChristian Kamm <[email protected]>2010-02-22 11:21:03 +0100
committerChristian Kamm <[email protected]>2010-02-22 11:21:25 +0100
commitfcb6c4984e1d43c8f3ef669fa4ef1548cc2d28de (patch)
treec90077a8e28b39bc4c1b5368fa64f3f257edb585 /src/libs/qmljs/qmljsinterpreter.cpp
parent28e348ace68533c5a40a5d4ce09337e31c092dee (diff)
Fix a memory leak with the QmlJS scope chain.
Diffstat (limited to 'src/libs/qmljs/qmljsinterpreter.cpp')
-rw-r--r--src/libs/qmljs/qmljsinterpreter.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp
index 59acd90929b..89eb241d1f8 100644
--- a/src/libs/qmljs/qmljsinterpreter.cpp
+++ b/src/libs/qmljs/qmljsinterpreter.cpp
@@ -731,6 +731,25 @@ ScopeChain::ScopeChain()
{
}
+ScopeChain::QmlComponentChain::QmlComponentChain()
+ : rootObject(0), ids(0)
+{
+}
+
+ScopeChain::QmlComponentChain::~QmlComponentChain()
+{
+ qDeleteAll(instantiatingComponents);
+}
+
+void ScopeChain::QmlComponentChain::clear()
+{
+ qDeleteAll(instantiatingComponents);
+ instantiatingComponents.clear();
+ rootObject = 0;
+ functionScopes.clear();
+ ids = 0;
+}
+
void ScopeChain::QmlComponentChain::add(QList<const ObjectValue *> *list) const
{
foreach (QmlComponentChain *parent, instantiatingComponents)