summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsharedpointer.cpp
diff options
context:
space:
mode:
authorDebao Zhang <dbzhang800@gmail.com>2012-03-14 14:39:02 -0700
committerQt by Nokia <qt-info@nokia.com>2012-03-15 23:01:01 +0100
commit801832b8a39aef224d55c892022b6f9008ffc894 (patch)
tree9b9a182170124e647cde03e0c2a21a1280a7f41b /src/corelib/tools/qsharedpointer.cpp
parente640c3bcfefe02261cfa74227128da70837cc834 (diff)
QSharedPointer: remove two emtpy functions.
As the comments says:they are broken by design, and replaced with other functions. The purpose of their existence is for BIC with Qt4.5. Change-Id: I9453f816a7b7c6812499b89b7c60f0fd99dea27c Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qsharedpointer.cpp')
-rw-r--r--src/corelib/tools/qsharedpointer.cpp37
1 files changed, 2 insertions, 35 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 77c3d1e2cb..58c62f0a3e 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -1380,47 +1380,14 @@ Q_GLOBAL_STATIC(KnownPointers, knownPointers)
QT_BEGIN_NAMESPACE
namespace QtSharedPointer {
- Q_CORE_EXPORT void internalSafetyCheckAdd(const volatile void *);
- Q_CORE_EXPORT void internalSafetyCheckRemove(const volatile void *);
Q_AUTOTEST_EXPORT void internalSafetyCheckCleanCheck();
}
/*!
\internal
*/
-void QtSharedPointer::internalSafetyCheckAdd(const volatile void *)
+void QtSharedPointer::internalSafetyCheckAdd(const void *d_ptr, const volatile void *ptr)
{
- // Qt 4.5 compatibility
- // this function is broken by design, so it was replaced with internalSafetyCheckAdd2
- //
- // it's broken because we tracked the pointers added and
- // removed from QSharedPointer, converted to void*.
- // That is, this is supposed to track the "top-of-object" pointer in
- // case of multiple inheritance.
- //
- // However, it doesn't work well in some compilers:
- // if you create an object with a class of type A and the last reference
- // is dropped of type B, then the value passed to internalSafetyCheckRemove could
- // be different than was added. That would leave dangling addresses.
- //
- // So instead, we track the pointer by the d-pointer instead.
-}
-
-/*!
- \internal
-*/
-void QtSharedPointer::internalSafetyCheckRemove(const volatile void *)
-{
- // Qt 4.5 compatibility
- // see comments above
-}
-
-/*!
- \internal
-*/
-void QtSharedPointer::internalSafetyCheckAdd2(const void *d_ptr, const volatile void *ptr)
-{
- // see comments above for the rationale for this function
KnownPointers *const kp = knownPointers();
if (!kp)
return; // end-game: the application is being destroyed already
@@ -1453,7 +1420,7 @@ void QtSharedPointer::internalSafetyCheckAdd2(const void *d_ptr, const volatile
/*!
\internal
*/
-void QtSharedPointer::internalSafetyCheckRemove2(const void *d_ptr)
+void QtSharedPointer::internalSafetyCheckRemove(const void *d_ptr)
{
KnownPointers *const kp = knownPointers();
if (!kp)