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 #28360 is a reply to message #28295] Mon, 03 December 2001 07:15 Go to previous message
mvukovic is currently offline  mvukovic
Messages: 63
Registered: July 1998
Member
David Fanning <david@dfanning.com> wrote in message news:<MPG.1670836a9029670e9897a1@news.frii.com>...
> Mark Hadfield (m.hadfield@niwa.cri.nz) writes:
>
>> Hey, I didn't know you *could* supply arguments to OBJ_DESTROY (though I
>> should have known because it's right there in the OBJ_DESTROY
>> documentation). Has anyone actually written code that *uses* this feature.
>> And if so, why? It seems to me that when you tell an object to destroy
>> itself, then it's up to the object to know how to do it.
>
> I've never used it. (Guess I should make a habit
> of reading the documentation that *is* there!)
> But I can imagine a case for it.
>
> 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.
>
> Cheers,
>
> David


An object should know what heap variables it created, and thus, only
destroy those heap variables (that the object itself created). All
other heap variables that were passed to it from the outside should
not be within its responsabilities.

Mirko
[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 16:52:06 PDT 2025

Total time taken to generate the page: 0.00378 seconds