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

Home » Public Forums » archive » losing pointers when concatenating array of structures
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: losing pointers when concatenating array of structures [message #94051 is a reply to message #94050] Mon, 09 January 2017 02:10 Go to previous messageGo to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
Well, pointers are tricky sometimes. I will try to explain. The
statement
structarray=struct
in the first loop-path creates a new structure with a new pointer
variable pointing to the _same_ heap variable as struct.array. The
heap variable is _not_ copied.

Undefine is not an IDL routine. I assume you have downloaded this
procedure from the Coyote library. In the second loop path undefine
destroys the struct.array pointer. I.e. it deletes the heap variable
pointed to by struct.array as well as structarray.array.

Your fix with temporary(struct) moves the structure from struct to
structarray. The undefine procedure can't delete the heap variable
anymore, because struct is undefined at that time.

I'm not sure, that I use the right terms in my explanation. I hope, it
gets clear for you yet.

Heinz
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mismatch between video frame dimensions and stream using Coyote graphics
Next Topic: how to overplot a vertical line in the existing plot made using plot function?

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

Current Time: Sun Oct 12 07:28:18 PDT 2025

Total time taken to generate the page: 0.24325 seconds