comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Destroying objects
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Destroying objects [message #82763] Fri, 18 January 2013 08:33
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Hi,
as usual I'm do things wrong believing I'm not until I wake-up.
So here's the thing. I'm using a structure to describe some objects. In my case these are regions of interest. Within this structure I have real objects. So that my structure looks something like this:

MyStruct = {ROI_Structure, a:ID_Nr, b:SomeOtherParameter, c:Obj_new()}
I then fill in MyStruct.c by doing something like this:
XROI, MyImage, REGIONS_OUT = XROI_ObjRef
MyStruct.c = XROI_ObjRef

The thing is that I then replicate this structure when I add new ROIs.
So I end up with say 10 {ROI_Structure} where for each element I did something like this:
for i=0,9 do MyStruct[i].c = XROI_ObjRef[i]

If and when somewhere later in the program I want to delete object number 5... do I have to take care of using
Obj_destroy, MyStruct[5].c

Is there no alternative?
Thing is, in this structure I have many pointers and objects...

I'm I wrong in saying that I have to do the good-boy bookkeeping and free/destroy for each deleted structure element all pointers and objects?

Thanks,
Helder
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Region_Grow kills IDL Workbench on Windows
Next Topic: Destroying objects

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:51:41 PDT 2025

Total time taken to generate the page: 0.72090 seconds