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 
Return to the default flat view Create a new topic Submit Reply
Re: Destroying objects [message #82757 is a reply to message #37981] Fri, 18 January 2013 09:50 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Helder writes:

> 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?

I'm not sure what the problem is, Helder. Doesn't this, do the job:

Obj_Destroy, myStruct.c[*]

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Destroying objects
Next Topic: Re: shading/outlining on surface plot

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

Current Time: Sun Oct 12 01:27:24 PDT 2025

Total time taken to generate the page: 0.80189 seconds