summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-07-27 19:16:34 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-07-27 19:16:34 (GMT)
commit96fbc28c9b4e8e97eec43b99fc18ad29c269bd25 (patch)
tree5ff91a5171578e3e7835b37f9ceb83b243351d34 /src/corelib/tools
parentef105812bd65d7536f2d403dd3b65a0b77ea843c (diff)
downloadQt-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/corelib/tools')
-rw-r--r--src/corelib/tools/qsharedpointer.cpp28
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h6
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)