summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-23 06:03:30 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-23 06:03:30 (GMT)
commit0e35dfc313523d42ad9a4fdaf6e33729562cd033 (patch)
tree05d6298f3634496ed32ddeec9d3f7a143777fc47 /src/corelib
parentbb2b9362ced23ff2aae824ef001efe7a34b464cc (diff)
parentfa0359bbf8063c74827f1267e7b40dd56ce42ad6 (diff)
downloadQt-0e35dfc313523d42ad9a4fdaf6e33729562cd033.zip
Qt-0e35dfc313523d42ad9a4fdaf6e33729562cd033.tar.gz
Qt-0e35dfc313523d42ad9a4fdaf6e33729562cd033.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Fix access to uninitialised memory in case of new throwing
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 4cce339..2519a22 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -378,6 +378,13 @@ namespace QtSharedPointer {
inline ExternalRefCount() : d(0) { }
inline ExternalRefCount(Qt::Initialization i) : Basic<T>(i) { }
+
+ inline ExternalRefCount(T *ptr) : Basic<T>(Qt::Uninitialized) // throws
+ { internalConstruct(ptr); }
+ template <typename Deleter>
+ inline ExternalRefCount(T *ptr, Deleter d) : Basic<T>(Qt::Uninitialized) // throws
+ { internalConstruct(ptr, d); }
+
inline ExternalRefCount(const ExternalRefCount<T> &other) : Basic<T>(other), d(other.d)
{ if (d) ref(); }
template <class X>
@@ -448,11 +455,12 @@ public:
inline QSharedPointer() { }
// inline ~QSharedPointer() { }
- inline explicit QSharedPointer(T *ptr) : BaseClass(Qt::Uninitialized)
- { BaseClass::internalConstruct(ptr); }
+ inline explicit QSharedPointer(T *ptr) : BaseClass(ptr) // throws
+ { }
template <typename Deleter>
- inline QSharedPointer(T *ptr, Deleter d) { BaseClass::internalConstruct(ptr, d); }
+ inline QSharedPointer(T *ptr, Deleter d) : BaseClass(ptr, d) // throws
+ { }
inline QSharedPointer(const QSharedPointer<T> &other) : BaseClass(other) { }
inline QSharedPointer<T> &operator=(const QSharedPointer<T> &other)