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

Home » Public Forums » archive » Re: Object Data and pointer assignments
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: Object Data and pointer assignments [message #19316 is a reply to message #19310] Thu, 09 March 2000 00:00 Go to previous messageGo to previous message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
David Fanning wrote:

> You don't leak any memory because IDL is managing this
> whole process for you. (Remember, these pointers are
> not real pointers in the C sense. They are really
> glorified variables in the IDL sense.) This is the
> bestest feature of IDL pointers. :-)
>

Thanks for the tips. It's probably a good thing that I don't know much about
C (no bad habits, eh?)


>
> If you overwrite the pointer like this:
>
> self.InArray = Ptr_New(newStruct)
>
> you *will* leak memory because now you destroyed the
> only reference to that pointer area of memory. You could
> do this:
>
>

So, if I am following your instruction correctly, I should only see ...

self.InArray = Ptr_New(newStruct)

once in my code in the INIT function. Thereafter (in SetProperty for
example) it is simply derefence....

*self.inarray = newStruct

Thanks again,

Ben



--
Ben Tupper

Bigelow Laboratory for Ocean Science
tupper@seadas.bigelow.org

pemaquidriver@tidewater.net
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Q: contour levels from IDL
Next Topic: Re: IDL and Linux on dual processor

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

Current Time: Sat Oct 11 20:03:31 PDT 2025

Total time taken to generate the page: 0.24190 seconds