[vtkusers] vtkImageData::Delete()

Veerapuram Varadhan v.varadhan at gmail.com
Thu Jul 15 01:03:34 EDT 2004


Hi Madhu,

My situation was like this....

I had class A and class B.  imgData was a member of class A.  
I did a objB->SetInput (objA->GetImgData()); where in the setinput of
class B doesn't increment the reference count of imgData and in the
Destructor of class B, the imgData set as input was being
de-allocated.  Thus creating a memory exception in the destructor of
class A.

As far as I understand, this is just a reference count problem.  The
default reference count, ie., 1, is getting decremented in the course
of flow.

HTH,

V. Varadhan.


----- Original Message -----
From: Madhusudhanan Balasubramanian <madhu_lsu at yahoo.com>
Date: Tue, 13 Jul 2004 08:39:11 -0700 (PDT)
Subject: Re: [vtkusers] vtkImageData::Delete()
To: Veerapuram Varadhan <v.varadhan at gmail.com>


Hi V. Varadhan,

 

Yes, imgData (vtkImageData *) is a member and is initialized in the
constructor and destroyed in the destructor.  I would appreciate you
sharing your experience.

 

Thanks,

Madhu.



Veerapuram Varadhan <v.varadhan at gmail.com> wrote:



Hi Madhu,

Is imgData a member of any of your classes? If so, are you
instantiating it in the constructor of the class? Could you give me
more hint about the code snippet, probably, i will able to share my
experience, since, i too once faced such problems.

V. Varadhan.


----- Original Message -----
From: Madhusudhanan Balasubramanian 
Date: Fri, 9 Jul 2004 10:00:43 -0700 (PDT)
Subject: [vtkusers] vtkImageData::Delete()
To: vtkusers at vtk.org


Hi all,



Here is a code fragment I used for allocating and deallocating
vtkImageData instance.



imgData = vtkImageData::New();

.

.

imgData->Delete();

.

.



I've problem deallocating the previously allocated vtkImageData
instance. It throws up exception when Delete() is called in
 the
destructor. Do any of you know what's with this code?



Madhu.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com



More information about the vtkusers mailing list