[Insight-developers] Small modification to ImportImageContainer

Tom Vercauteren tom.vercauteren at m4x.org
Tue Mar 31 13:37:17 EDT 2009


Hi,

Sorry for being so noisy on this topic.

I have implemented a new version of ImportImageContainer. All the
deallocation takes place within
  virtual void DeallocateManagedMemory();

Here is what this function does:
  if (m_ImportPointer && m_ContainerManageMemory) delete [] m_ImportPointer;
  m_ImportPointer = 0; m_Capacity = 0; m_Size = 0;

I have also put the members of ImportImageContainer back into the
private section and added some protected set accessors for them.

The attached patch provides all these modifications together with an
enhanced  itkObjectFactoryTest2 unit test. itkFactoryTestLib.cxx
(which is used by itkObjectFactoryTest2) implements
TestImportImageContainer, a class that derives from
ImportImageContainer but uses a std::allocator instead of using new
and delete .

Let me know, if such a patch seems more appropriate.

Regards,
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itk-importcontainer.patch
Type: text/x-patch
Size: 8860 bytes
Desc: not available
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090331/860b40a2/attachment.bin>


More information about the Insight-developers mailing list