Re: mkref / unref
Luca Padovani <[email protected]> Thu, 22 Jan 2004 13:16:13 +0100
| Newsgroups | gmane.comp.gnome.gdome |
|---|---|
| Message-ID | <1074773773.755.5.camel@giraffe> |
Hi,
On Thu, 2004-01-22 at 12:30, Laurent Marzullo wrote:
> Should I write unref for each and only each mkref or should
> I also write unref when getting object via other method ?
the second one. If a method returns an object, then the object's
reference count has been incremented.
> Ex:
> void
> my_function( void )
> {
> GdomeElement* elt = gdome_doc_documentElement( mydoc , &excp );
> // Shoul I write
> gdome_el_unref( elt , &excp );
> // or not ?
> }
yes you should
Cheers,
-- luca