diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-24 16:57:06 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-25 08:36:34 (GMT) |
commit | 3636e666528b72de79f8c7012690bb9e279f0863 (patch) | |
tree | ed99d1e098f059a10fdf39f0db820c2dd951098a /src/script/bridge | |
parent | 042f15fefd19584c546cb55f24c4c79c4d76529c (diff) | |
download | Qt-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')
-rw-r--r-- | src/script/bridge/qscriptobject.cpp | 2 |
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; } |