summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-06-25 09:32:06 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-06-25 09:42:17 (GMT)
commit4b9784fcdd7321a5d82b8ae73edd1ae52786d7ad (patch)
tree1af93a46f3f32274b3ae570965c666a53080cdfe /src/corelib/tools
parent10977eb209e743cf0010fd43ecf66f96815fad2f (diff)
downloadQt-4b9784fcdd7321a5d82b8ae73edd1ae52786d7ad.zip
Qt-4b9784fcdd7321a5d82b8ae73edd1ae52786d7ad.tar.gz
Qt-4b9784fcdd7321a5d82b8ae73edd1ae52786d7ad.tar.bz2
Change QSharedPointer to track (or not) pointers when the #define is
enabled. This allows mixing of debug and non-debug code (possible on Unix systems) without causing assertion failures. Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h6
-rw-r--r--src/corelib/tools/tools.pri2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 928805a..0471a1b 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -48,6 +48,8 @@
#pragma qt_sync_stop_processing
#endif
+#include <QtCore/qatomic.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -138,14 +140,14 @@ namespace QtSharedPointer {
inline void internalConstruct(T *ptr)
{
-#ifndef QT_NO_DEBUG
+#ifdef QT_SHAREDPOINTER_TRACK_POINTERS
if (ptr) internalSafetyCheckAdd(ptr);
#endif
value = ptr;
}
inline void internalDestroy()
{
-#ifndef QT_NO_DEBUG
+#ifdef QT_SHAREDPOINTER_TRACK_POINTERS
if (value) internalSafetyCheckRemove(value);
#endif
}
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index e5bf7e4..b70c7df 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -26,6 +26,8 @@ HEADERS += \
tools/qregexp.h \
tools/qringbuffer_p.h \
tools/qshareddata.h \
+ tools/qsharedpointer.h \
+ tools/qsharedpointer_impl.h \
tools/qset.h \
tools/qsize.h \
tools/qstack.h \