diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-05-11 11:25:21 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-05-11 11:28:12 (GMT) |
commit | 60ff41273a58835466022f91d4f6eb195953c739 (patch) | |
tree | 5c351cd1cfbf87bb390365d30c1e274a428b8e18 /src | |
parent | 887b6074e149d5302316eb57b908c051955fa4f6 (diff) | |
download | Qt-60ff41273a58835466022f91d4f6eb195953c739.zip Qt-60ff41273a58835466022f91d4f6eb195953c739.tar.gz Qt-60ff41273a58835466022f91d4f6eb195953c739.tar.bz2 |
Don't leak memory when assigning scriptvalue to iterator
The d-pointer was not deleted as it should be.
Reviewed-by: Harald Fernengel
Diffstat (limited to 'src')
-rw-r--r-- | src/script/qscriptvalueiterator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/qscriptvalueiterator.cpp b/src/script/qscriptvalueiterator.cpp index fe5ef9f..1a60632 100644 --- a/src/script/qscriptvalueiterator.cpp +++ b/src/script/qscriptvalueiterator.cpp @@ -106,6 +106,7 @@ QScriptValueIteratorPrivate::QScriptValueIteratorPrivate() */ QScriptValueIteratorPrivate::~QScriptValueIteratorPrivate() { + delete it; } /*! @@ -130,7 +131,6 @@ QScriptValueIterator::QScriptValueIterator(const QScriptValue &object) QScriptValueIterator::~QScriptValueIterator() { if (d_ptr) { - delete d_ptr->it; delete d_ptr; d_ptr = 0; } @@ -312,7 +312,7 @@ void QScriptValueIterator::remove() QScriptValueIterator& QScriptValueIterator::operator=(QScriptValue &object) { if (d_ptr) { - delete d_ptr->it; + delete d_ptr; d_ptr = 0; } QScriptValueImpl val = QScriptValuePrivate::valueOf(object); |