summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-08-25 08:54:07 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-08-25 09:06:30 (GMT)
commit0e9b080a8ff44a86f30be5f3a7c5ac0c8722dbb5 (patch)
treeeb0230f259dc248cbc4daaed696da2cf080c0198 /src/script
parent3b39bce54231edb1845b42a1e914029dcb494c94 (diff)
downloadQt-0e9b080a8ff44a86f30be5f3a7c5ac0c8722dbb5.zip
Qt-0e9b080a8ff44a86f30be5f3a7c5ac0c8722dbb5.tar.gz
Qt-0e9b080a8ff44a86f30be5f3a7c5ac0c8722dbb5.tar.bz2
Another memoryleak in QScriptEngine
QScriptValuePrivate released by garbage collector later in ~QScriptEnginePrivate (when destroying the agents) would be added to the freelist and not be released Reviewed-by: Kent Hansen
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/qscriptengine.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index f4e9594..c14e38a 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -836,11 +836,6 @@ QScriptEnginePrivate::QScriptEnginePrivate()
QScriptEnginePrivate::~QScriptEnginePrivate()
{
- while (freeScriptValues) {
- QScriptValuePrivate *p = freeScriptValues;
- freeScriptValues = p->next;
- qFree(p);
- }
while (!ownedAgents.isEmpty())
delete ownedAgents.takeFirst();
detachAllRegisteredScriptValues();
@@ -849,6 +844,11 @@ QScriptEnginePrivate::~QScriptEnginePrivate()
JSC::JSLock lock(false);
globalData->heap.destroy();
globalData->deref();
+ while (freeScriptValues) {
+ QScriptValuePrivate *p = freeScriptValues;
+ freeScriptValues = p->next;
+ qFree(p);
+ }
}
QScriptValue QScriptEnginePrivate::scriptValueFromVariant(const QVariant &v)