add G_DEFINE_AUTOPTR_CLEANUP_FUNC to support g_autoptr
g_autoptr
is available automatically if those structures, GrlMedia
, GrlOperationOptions
(in this case) are declared with G_DECLARE_*
macros. However, for some reasons (GRL_PADDING, or breaking ABI), it is kind of dangerous that they are migrated to G_DECLARE_*
without any knowledge. Instead, G_DEFINE_AUTOPTR_CLEANUP_FUNC
is added to support g_autoptr.
The commits are not only related to those TODOs, https://gitlab.gnome.org/GNOME/gnome-photos/blob/master/src/photos-flickr-item.c#L150, and gnome-photos#77, but also to support it for newly-written applications.
TODO
-
Implement test cases for g_autoptr. -
Add the cleanup macro to other classes.
Edited by Leesoo Ahn