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

Home » Public Forums » archive » Re: Leaking 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: Leaking objects... [message #29930 is a reply to message #29928] Wed, 27 March 2002 08:29 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Randall Skelton (rhskelto@atm.ox.ac.uk) writes:

> I gave some IDL object code to someone who has no idea what object
> programming is. Despite giving her a quick lesson on object life-cycles,
> she did the inevitable and directly overwrote an object, creating dangling
> pointers.
>
> My question is, how do I prevent this from happening in my code? This
> behavior seems a little fragile to me. Ideally, I would like obj_new to
> either block the creation of a new object or cleanup pre-existing objects.
> What I don't want to do is try and educate the user again... sorry mom.

You may *think* you want Obj_New to block the creation
of a new object, but I can assure you, you *don't*. :-)
Having only one of any particular kind of object would
be just a tad limiting, don't you think?

IDL is an inherently dangerous language. You really don't
have any choice but to make an attempt to educate the
people who use it. If we didn't believe this, why else
would we all be hanging out here on the newsgroup?

Cheers,

David

P.S. You might suggest to your user that she become
more familiar with HEAP_GC. That might help. :-)

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Previous Topic: Computer freezes when IDL 5.5 tries to display an image larger than the given window
Next Topic: Re: clipping with polyfill

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

Current Time: Sat Oct 11 12:59:30 PDT 2025

Total time taken to generate the page: 0.23704 seconds