Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
fcb6c498
Commit
fcb6c498
authored
Feb 22, 2010
by
Christian Kamm
Browse files
Fix a memory leak with the QmlJS scope chain.
parent
28e348ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/libs/qmljs/qmljsinterpreter.cpp
View file @
fcb6c498
...
...
@@ -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
)
...
...
src/libs/qmljs/qmljsinterpreter.h
View file @
fcb6c498
...
...
@@ -229,9 +229,8 @@ public:
struct
QmlComponentChain
{
QmlComponentChain
()
:
rootObject
(
0
),
ids
(
0
)
{}
QmlComponentChain
();
~
QmlComponentChain
();
QList
<
QmlComponentChain
*>
instantiatingComponents
;
const
ObjectValue
*
rootObject
;
...
...
@@ -239,6 +238,7 @@ public:
const
ObjectValue
*
ids
;
void
add
(
QList
<
const
ObjectValue
*>
*
list
)
const
;
void
clear
();
};
const
ObjectValue
*
globalScope
;
...
...
src/libs/qmljs/qmljslink.cpp
View file @
fcb6c498
...
...
@@ -48,6 +48,7 @@ void Link::scopeChainAt(Document::Ptr doc, const QList<Node *> &astPath)
if
(
doc
->
qmlProgram
())
{
_context
->
setLookupMode
(
Context
::
QmlLookup
);
scopeChain
.
qmlComponentScope
.
clear
();
makeComponentChain
(
doc
,
&
scopeChain
.
qmlComponentScope
,
&
componentScopes
);
if
(
const
ObjectValue
*
typeEnvironment
=
_context
->
typeEnvironment
(
doc
.
data
()))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment