[vtkusers] A template to avoid calling vtkObjectBase->Delete()

REGAT-BARREL Aurélien arbvtk at yahoo.fr
Wed Apr 28 12:01:51 EDT 2004


Hello,
I know vtkSmartPointer, and my template is much inspired from it.
But, I don't understand how to use it in order to do what i want :

Let's have a look at your example :

vtkSmartPointer<vtkConeSource> cone =
   vtkSmartPointer<vtkConeSource>::New();


It calls the constructors :

vtkSmartPointer(T* r): vtkSmartPointerBase(r) {}

wich calls

vtkSmartPointerBase::vtkSmartPointerBase(vtkObjectBase* r):
  Object(r)
{
  this->Register();
}


destructors :

vtkSmartPointerBase::~vtkSmartPointerBase()
{
  this->UnRegister();
}


The problem is this->Register(); in vtkSmartPointerBase constructor.

This is the main difference with my template.

So your code doesn't work because we still need to call cone->Delete();

What am I missing ?



Aurélien REGAT-BARREL
		
---------------------------------
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040428/8493df14/attachment.htm>


More information about the vtkusers mailing list