diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-27 19:16:34 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-27 19:16:34 (GMT) |
commit | 96fbc28c9b4e8e97eec43b99fc18ad29c269bd25 (patch) | |
tree | 5ff91a5171578e3e7835b37f9ceb83b243351d34 /src | |
parent | ef105812bd65d7536f2d403dd3b65a0b77ea843c (diff) | |
download | Qt-96fbc28c9b4e8e97eec43b99fc18ad29c269bd25.zip Qt-96fbc28c9b4e8e97eec43b99fc18ad29c269bd25.tar.gz Qt-96fbc28c9b4e8e97eec43b99fc18ad29c269bd25.tar.bz2 |
Disable the pointer tracking feature in Qt 4.5.
The functionality is broken, since pointers can be released by a
QSharedPointer tracking a pointer of different type, which would leave
behind pointers in the hash.
The fix requires Qt 4.6 because of a new symbol being added.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qsharedpointer.cpp | 28 | ||||
-rw-r--r-- | src/corelib/tools/qsharedpointer_impl.h | 6 |
2 files changed, 5 insertions, 29 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index ba62ce1..c9dccd3 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -833,42 +833,24 @@ namespace { }; } -Q_GLOBAL_STATIC(KnownPointers, knownPointers) +//Q_GLOBAL_STATIC(KnownPointers, knownPointers) QT_BEGIN_NAMESPACE /*! \internal */ -void QtSharedPointer::internalSafetyCheckAdd(const volatile void *ptr) +void QtSharedPointer::internalSafetyCheckAdd(const volatile void *) { - KnownPointers *const kp = knownPointers(); - if (!kp) - return; // end-game: the application is being destroyed already - - QMutexLocker lock(&kp->mutex); - void *actual = const_cast<void*>(ptr); - if (kp->values.contains(actual)) { - printBacktrace(knownPointers()->values.value(actual)); - qFatal("QSharedPointerData: internal self-check failed: pointer %p was already tracked " - "by another QSharedPointerData object", actual); - } - - kp->values.insert(actual, saveBacktrace()); + // functionality is broken + // fix requires Qt 4.6 } /*! \internal */ -void QtSharedPointer::internalSafetyCheckRemove(const volatile void *ptr) +void QtSharedPointer::internalSafetyCheckRemove(const volatile void *) { - KnownPointers *const kp = knownPointers(); - if (!kp) - return; // end-game: the application is being destroyed already - - QMutexLocker lock(&kp->mutex); - void *actual = const_cast<void*>(ptr); - kp->values.remove(actual); } QT_END_NAMESPACE diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 0471a1b..7aaed22 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -140,16 +140,10 @@ namespace QtSharedPointer { inline void internalConstruct(T *ptr) { -#ifdef QT_SHAREDPOINTER_TRACK_POINTERS - if (ptr) internalSafetyCheckAdd(ptr); -#endif value = ptr; } inline void internalDestroy() { -#ifdef QT_SHAREDPOINTER_TRACK_POINTERS - if (value) internalSafetyCheckRemove(value); -#endif } #if defined(Q_NO_TEMPLATE_FRIENDS) |