For Programmers: Free Programming Magazines  


Home > Archive > Clipper > February 2005 > Item API quicky - _itemRelease()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Item API quicky - _itemRelease()
Martin

2005-02-23, 8:55 am

I have found in some old code a _potential_ issue

// Put the value into element
elem = _itemPutNL( elem, (long) val );

later in the code

_itemRelease( elem );

Now will the reassign of elem be a problem to the garbage collector, ie will
it all be cleared up by _itemRelease() or do I need to add another variable
to do this.

Thanks

Martin


Dave Pearson

2005-02-23, 3:55 pm

* Martin <spamspam@spam.spam>:

> I have found in some old code a _potential_ issue
>
> // Put the value into element
> elem = _itemPutNL( elem, (long) val );
>
> later in the code
>
> _itemRelease( elem );
>
> Now will the reassign of elem be a problem to the garbage collector, ie
> will it all be cleared up by _itemRelease() or do I need to add another
> variable to do this.


The usage given above seems consistent with the documentation and the
example given in the documentation. In fact, if you look at the example
given in the documentation for _itemPutNL(), you'll notice it does pretty
much what you're doing here.

--
Dave Pearson | OSLib - Timeslice release functions.
http://www.davep.org/ | eg - Norton Guide reader for Linux.
http://www.davep.org/clipper/ | weg - Norton Guide reader for Windows.
http://www.davep.org/norton-guides/ | dgscan - DGROUP scanner for Clipper.
Martin

2005-02-24, 8:55 am

>>The usage given above seems consistent with the documentation and the[color=darkred]

Just had a look - that's correct so it must be OK.

I was just a little unsure as I am not very experienced with C - all of my C
programs have been related to various XBASE front ends


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com