diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-23 22:14:53 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-23 22:14:53 (GMT) |
commit | 890c1110ec5e39bb6e63e99fe09c296c1ea824be (patch) | |
tree | 32a8e19846a83cef4abf6b40125331a19e4fef01 /src | |
parent | bb2b9362ced23ff2aae824ef001efe7a34b464cc (diff) | |
parent | bdef6d2613b424dffd49ce1bced8213670aec1e9 (diff) | |
download | Qt-890c1110ec5e39bb6e63e99fe09c296c1ea824be.zip Qt-890c1110ec5e39bb6e63e99fe09c296c1ea824be.tar.gz Qt-890c1110ec5e39bb6e63e99fe09c296c1ea824be.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 warning introduced by last commit on hiding of the 'd' member
Fix access to uninitialised memory in case of new throwing
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qsharedpointer_impl.h | 14 |
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..2895bba 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 deleter) : Basic<T>(Qt::Uninitialized) // throws + { internalConstruct(ptr, deleter); } + 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) |