summaryrefslogtreecommitdiffstats
path: root/src/script/bridge/qscriptobject.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-08-24 16:57:06 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-08-25 08:36:34 (GMT)
commit3636e666528b72de79f8c7012690bb9e279f0863 (patch)
treeed99d1e098f059a10fdf39f0db820c2dd951098a /src/script/bridge/qscriptobject.cpp
parent042f15fefd19584c546cb55f24c4c79c4d76529c (diff)
downloadQt-3636e666528b72de79f8c7012690bb9e279f0863.zip
Qt-3636e666528b72de79f8c7012690bb9e279f0863.tar.gz
Qt-3636e666528b72de79f8c7012690bb9e279f0863.tar.bz2
Fix memory leak in QScriptEngine::newQObject
Do not reset the delegate and the prototype when reusing existing wrapper. Reviewed-by: Kent Hansen
Diffstat (limited to 'src/script/bridge/qscriptobject.cpp')
-rw-r--r--src/script/bridge/qscriptobject.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script/bridge/qscriptobject.cpp b/src/script/bridge/qscriptobject.cpp
index 2022baf..e59c542 100644
--- a/src/script/bridge/qscriptobject.cpp
+++ b/src/script/bridge/qscriptobject.cpp
@@ -95,6 +95,8 @@ void QScriptObject::setDelegate(QScriptObjectDelegate *delegate)
{
if (!d)
d = new Data();
+ else
+ delete d->delegate;
d->delegate = delegate;
}