[Lldb-commits] [lldb] r149136 - /lldb/trunk/include/lldb/Utility/SharingPtr.h
gclayton at apple.com
Fri Jan 27 10:33:53 PST 2012
Date: Fri Jan 27 12:33:53 2012
New Revision: 149136
NULL out the "ptr_" member of shared pointers for debug and release
builds (not build and integration builds) to help catch when a shared pointer
that might be in a collection class is used after the collection
has been freed.
--- lldb/trunk/include/lldb/Utility/SharingPtr.h (original)
+++ lldb/trunk/include/lldb/Utility/SharingPtr.h Fri Jan 27 12:33:53 2012
@@ -684,6 +684,15 @@
+#if defined (LLDB_CONFIGURATION_DEBUG) || defined (LLDB_CONFIGURATION_RELEASE)
+ // NULL out the pointer in objects which can help with leaks detection.
+ // We don't enable this for LLDB_CONFIGURATION_BUILD_AND_INTEGRATION or
+ // when none of the LLDB_CONFIGURATION_XXX macros are defined since
+ // those would be builds for release. But for debug and release builds
+ // that are for development, we NULL out the pointers to catch potential
+ // issues.
+ ptr_ = NULL;
+#endif // #if defined (LLDB_CONFIGURATION_DEBUG) || defined (LLDB_CONFIGURATION_RELEASE)
More information about the lldb-commits