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

Home » Public Forums » archive » IDL objects (not object graphics) tutorial?
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: IDL objects (not object graphics) tutorial? [message #46612 is a reply to message #46457] Fri, 02 December 2005 08:11 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul Van Delst writes:

> Your webpage is great! The one new thing I learned:
>
> self.ptr=ptr_new(/allocate)
>
> can be used to subsequently point to anything without further allocation!? E.g. from your
> tutorial:
>
> a->set,image
> or
> a->set,!d
>
> where in the set method, the value is simply assigned:
> *(self.ptr)=value
>
> Excuse my brain-deadedness, but how is this possible? I looked at the IDL docs but there
> is (surprise, surprise) no elaboration about this little nugget of information regarding
> PTR_NEW. Wouldn't susbsequent calls like the above cause a memory leak, e.g.
>
> IDL> image=findgen(512,512)
> IDL> a=obj_new('data') ;-- create object variable a
> IDL> a->set,image ;-- insert image
> IDL> a->set,!d
>
> What would happen to the "image" data?

The deep answers are all contained in the Pointer Tutorial:

http://www.dfanning.com/misc_tips/pointers.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: map_proj_inverse and map_proj_init IDL 6.2
Next Topic: Data General Floating Point format?

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

Current Time: Wed Oct 08 17:30:31 PDT 2025

Total time taken to generate the page: 0.00426 seconds