AW: gobject floating reference count
- From: "klaus triendl" <klaus triendl eu>
- To: "'Povietkin Konstantin'" <povetkin k gmail com>
- Cc: 'GTKMM-List' <gtkmm-list gnome org>
- Subject: AW: gobject floating reference count
- Date: Thu, 3 Feb 2011 21:57:28 +0100
> -----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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]