[vtkusers] question on memory + vtkactorcollection in c++

Gopalakrishnan, Gowri Gowri.Gopalakrishnan at inteq.com
Thu Sep 19 09:19:24 EDT 2002


Hi In the following scenario

 

 

vtkActor *myactor = vtkActor::New()

vtkActorCollection *col = vtkactorCollection::New()

col -> AddItem(myactor);

 

myactor -> Delete() // this deletes the  myactor (may be)

 

I can do, 

 

Col -> GetItem()->GetProperty->SetColor() to change the color of the
original actor......This works....

 

Does that mean myactor -> Delete() did not actually delete the actor since
its reference count is not zero....

So when will this actor be deleted?. When the reference goes to zero is it
automatically deleted?.

 

 

In addition before quitting the program if I do col->getActor()->Delete()
....this crashes ( possibly correct behaviour since this was not created
with a new....)

 

Can some one shed some light on this please.......

 

Thanks a lot

 

Regards

Gowri

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020919/f1a7bb6f/attachment.htm>


More information about the vtkusers mailing list