diff options
author | Robert Griebl <rgriebl@trolltech.com> | 2009-06-10 11:46:23 (GMT) |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2009-06-10 11:46:23 (GMT) |
commit | 7604f8087f88171ef933d8ae08f501467e647338 (patch) | |
tree | 51d071f462ed48d0b25884d9f62b8ba11c5dff13 /src/corelib/xml | |
parent | 8c265860b41214daade7c8a28237c1e07ea71a3c (diff) | |
download | Qt-7604f8087f88171ef933d8ae08f501467e647338.zip Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.gz Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.bz2 |
Make Qt exception safer.
Squashed commit of the branch haralds-haralds-qt-s60-topics/topic/exceptions,
which also contains the full history.
Rev-By: Harald Fernengel
Rev-By: Ralf Engels
Diffstat (limited to 'src/corelib/xml')
-rw-r--r-- | src/corelib/xml/qxmlstream.cpp | 5 | ||||
-rw-r--r-- | src/corelib/xml/qxmlstream.h | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index ff1a01f..6fe6ebf 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -429,7 +429,6 @@ QXmlStreamReader::~QXmlStreamReader() Q_D(QXmlStreamReader); if (d->deleteDevice) delete d->device; - delete d; } /*! \fn bool QXmlStreamReader::hasError() const @@ -819,7 +818,9 @@ inline void QXmlStreamReaderPrivate::reallocateStack() { stack_size <<= 1; sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value))); + Q_CHECK_PTR(sym_stack); state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int))); + Q_CHECK_PTR(sym_stack); } @@ -3131,8 +3132,6 @@ QXmlStreamWriter::QXmlStreamWriter(QString *string) */ QXmlStreamWriter::~QXmlStreamWriter() { - Q_D(QXmlStreamWriter); - delete d; } diff --git a/src/corelib/xml/qxmlstream.h b/src/corelib/xml/qxmlstream.h index 2ba7972..6903d56 100644 --- a/src/corelib/xml/qxmlstream.h +++ b/src/corelib/xml/qxmlstream.h @@ -48,6 +48,7 @@ #include <QtCore/QString> #include <QtCore/QVector> +#include <QtCore/QScopedPointer> QT_BEGIN_HEADER @@ -392,7 +393,7 @@ public: private: Q_DISABLE_COPY(QXmlStreamReader) Q_DECLARE_PRIVATE(QXmlStreamReader) - QXmlStreamReaderPrivate *d_ptr; + QScopedPointer<QXmlStreamReaderPrivate> d_ptr; }; #endif // QT_NO_XMLSTREAMREADER @@ -465,7 +466,7 @@ public: private: Q_DISABLE_COPY(QXmlStreamWriter) Q_DECLARE_PRIVATE(QXmlStreamWriter) - QXmlStreamWriterPrivate *d_ptr; + QScopedPointer<QXmlStreamWriterPrivate> d_ptr; }; #endif // QT_NO_XMLSTREAMWRITER |