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

Home » Public Forums » archive » Re: IDL Shapefile Object
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 Shapefile Object [message #28294 is a reply to message #28292] Thu, 29 November 2001 17:26 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
From: "David Fanning" <david@dfanning.com>
> Suppose one of the fields for the object was a
> pointer to some image data. The same image pointer
> might be present in several objects (to save
> copying the huge image). Any decent object cleanup
> routine would certainly free the pointer, but maybe
> you don't want it destroyed because then the other
> objects that are using it wouldn't work properly.
>
> In this case a HANG_ON_DONT_DO_IT keyword
> on the cleanup method might be appropriate.

I have run into this situation and when I did (in my ignorance) I added a
HANG_ON_DONT_DESTROY_THE_DATA keyword to the Init method and a corresponding
tag in the class structure. Then in the cleanup method:

if not self.hang_on_dont_destroy_the_data then $
ptr_free, thedata

If I had to justify doing it this way I would say that destruction of
objects is often carried out by code that doesn't know much about the
object's properties, and this is less true of object-creation code.

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research



--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Sparse matrix algorithms
Next Topic: Re: Setting history size in idlwave

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

Current Time: Wed Oct 08 20:14:45 PDT 2025

Total time taken to generate the page: 0.02349 seconds