Re: AW: gobject floating reference count



Thank you a lot!
В Чтв, 03/02/2011 в 21:57 +0100, klaus triendl пишет:
> > -----Ursprüngliche Nachricht-----
> > Von: gtkmm-list-bounces gnome org [mailto:gtkmm-list-
> > bounces gnome org] Im Auftrag von Povietkin Konstantin
> > Gesendet: Donnerstag, 03. Februar 2011 21:49
> > An: GTKMM-List
> > Betreff: gobject floating reference count
> > 
> > [...]
> > Can somebody explain me what shall I do if i want to get reference in this
> > situation:
> > 
> > void someFunc( GVariant * k )
> > {
> > 	k = some_glib_method( );
> > }
> > ....
> > GVariant * ref;
> > ....
> > 
> > someFunc( ref );
> 
> You have 3 possibilities:
> 
> void someFunc( GVariant ** k )
> {
> 	*k = some_glib_method( );
> }
> void someFunc( GVariant *& k )
> {
> 	k = some_glib_method( );
> }
> GVariant* someFunc()
> {
> 	return some_glib_method( );
> }
> ....
> GVariant * ref;
> ....
> 
> someFunc( &ref );
> someFunc( ref );
> ref =someFunc( );
> 
> 
> Greetings,
> Klaus
> 

-- 
"No Civilization = Freedom"
------------------------------------------------------------------------
Yes, I am a criminal. My crime is that of curiosity.

My crime is that of judging people by what they say and think, not what
they look like.

 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]