Should g_object_new match g_object_unref?

I use libnotify to display desktop notifications in the application; notify_notification_new()returns NotifyNotification*which should be passed as the first parameter for further calls to the notification library functions.

No notify_notification_free(), which frees the returned pointer. I searched for the source notify_notification_new()and internally it executes g_object_new(), gets GObject * and returns it as NotfiyNotification*, so when my application does the cleanup, should I call a g_object_unref()in the pointer returned notify_notification_new()?

+5
source share
2 answers

, . GInitiallyUnowned ; - GTK.

GTK gtk_whatever_new(), , . , . g_object_ref() ​​ 2, "" . , "" .

, , g_object_unref() , , . , .

, GObject s, , . , .

+10

: , Gnome , , - .

+3

All Articles