-
- Downloads
Refactor vtkDebugLeaks construction.
vtkDebugLeaks registers instance by class name, which worked well for many years. However, now that we have more templated code, this is becoming difficult. For instance, "template <typename T> vtkBuffer<T>" would be identified as "vtkBuffer<T>" when registering with vtkDebugLeaks, but deregistered with the compiler dependent typeid(vtkBuffer<T>).name() string returned from GetClassName(). This patch moves vtkDebugLeaks registrations to the method vtkObjectBase::InitializeObjectBase(), which must be called after the vtkObjectBase is instantiated. This ensures that objects are registered using the same string as when they are destroyed. In general, a call to "new vtkSomeClass" must be followed by a call to InitializeObjectBase on the new instance. The common ::New() implementation macros in vtkObjectFactory will ensure that registration happens correctly. Two notable exceptions are vtkCommand and vtkInformationKey subclasses. These do not require any specific handling for vtkDebugLeaks registration. See discussion at: http://vtk.1045678.n5.nabble.com/Proposal-Simplify-vtkDebugLeaks-registration-td5740222.html
Showing
- Common/Core/Testing/Cxx/TestDataArrayIterators.cxx 1 addition, 1 deletionCommon/Core/Testing/Cxx/TestDataArrayIterators.cxx
- Common/Core/Testing/Cxx/TestGarbageCollector.cxx 7 additions, 7 deletionsCommon/Core/Testing/Cxx/TestGarbageCollector.cxx
- Common/Core/Testing/Cxx/TestObjectFactory.cxx 10 additions, 9 deletionsCommon/Core/Testing/Cxx/TestObjectFactory.cxx
- Common/Core/vtkDebugLeaks.h 31 additions, 11 deletionsCommon/Core/vtkDebugLeaks.h
- Common/Core/vtkDenseArray.txx 7 additions, 6 deletionsCommon/Core/vtkDenseArray.txx
- Common/Core/vtkDynamicLoader.cxx 2 additions, 4 deletionsCommon/Core/vtkDynamicLoader.cxx
- Common/Core/vtkIndent.cxx 1 addition, 8 deletionsCommon/Core/vtkIndent.cxx
- Common/Core/vtkInformationDoubleKey.cxx 1 addition, 1 deletionCommon/Core/vtkInformationDoubleKey.cxx
- Common/Core/vtkInformationDoubleVectorKey.cxx 1 addition, 1 deletionCommon/Core/vtkInformationDoubleVectorKey.cxx
- Common/Core/vtkInformationIdTypeKey.cxx 1 addition, 1 deletionCommon/Core/vtkInformationIdTypeKey.cxx
- Common/Core/vtkInformationIntegerKey.cxx 1 addition, 1 deletionCommon/Core/vtkInformationIntegerKey.cxx
- Common/Core/vtkInformationIntegerPointerKey.cxx 1 addition, 1 deletionCommon/Core/vtkInformationIntegerPointerKey.cxx
- Common/Core/vtkInformationIntegerVectorKey.cxx 1 addition, 1 deletionCommon/Core/vtkInformationIntegerVectorKey.cxx
- Common/Core/vtkInformationKey.cxx 0 additions, 7 deletionsCommon/Core/vtkInformationKey.cxx
- Common/Core/vtkInformationKeyVectorKey.cxx 2 additions, 3 deletionsCommon/Core/vtkInformationKeyVectorKey.cxx
- Common/Core/vtkInformationObjectBaseVectorKey.cxx 1 addition, 1 deletionCommon/Core/vtkInformationObjectBaseVectorKey.cxx
- Common/Core/vtkInformationStringKey.cxx 1 addition, 1 deletionCommon/Core/vtkInformationStringKey.cxx
- Common/Core/vtkInformationStringVectorKey.cxx 1 addition, 1 deletionCommon/Core/vtkInformationStringVectorKey.cxx
- Common/Core/vtkInformationUnsignedLongKey.cxx 1 addition, 1 deletionCommon/Core/vtkInformationUnsignedLongKey.cxx
- Common/Core/vtkInformationVariantKey.cxx 1 addition, 1 deletionCommon/Core/vtkInformationVariantKey.cxx
Loading
Please register or sign in to comment