mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2024-12-22 04:38:55 +00:00
Add support for g_autoptr() to our types
g_autoptr() is a macro that was defined in GLib 2.44 that allows for basic auto-cleanup of variables. One way to add this kind of support would be through the use of e.g. `G_DECLARE_DERIVABLE_TYPE()` for our declarations, but this would consitute an ABI break (due to the `...Private *` field in the public structs). Instead, we can use `G_DEFINE_AUTOPTR_CLEANUP_FUNC` to manually declare this. This commit also bumps the minimally required GLib version to 2.44
This commit is contained in:
parent
92e9952ba2
commit
80afd20c19
@ -9,9 +9,9 @@ dnl Dependency versions
|
||||
|
||||
# Required
|
||||
|
||||
GLIB_REQ=2.38.0
|
||||
GLIB_MIN=GLIB_VERSION_2_38
|
||||
GLIB_MAX=GLIB_VERSION_2_38
|
||||
GLIB_REQ=2.44.0
|
||||
GLIB_MIN=GLIB_VERSION_2_44
|
||||
GLIB_MAX=GLIB_VERSION_2_44
|
||||
|
||||
# Optional
|
||||
|
||||
|
@ -173,6 +173,8 @@ guint64 secret_collection_get_created (SecretCollection
|
||||
|
||||
guint64 secret_collection_get_modified (SecretCollection *self);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SecretCollection, g_object_unref);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __SECRET_COLLECTION_H___ */
|
||||
|
@ -191,6 +191,8 @@ guint64 secret_item_get_created (SecretItem *self);
|
||||
|
||||
guint64 secret_item_get_modified (SecretItem *self);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SecretItem, g_object_unref);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __SECRET_ITEM_H___ */
|
||||
|
@ -56,6 +56,8 @@ SecretSync * _secret_sync_new (void);
|
||||
|
||||
void _secret_sync_free (gpointer data);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SecretSync, _secret_sync_free)
|
||||
|
||||
void _secret_sync_on_result (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data);
|
||||
@ -185,6 +187,8 @@ gchar * _secret_value_unref_to_string (SecretValue *valu
|
||||
|
||||
void _secret_session_free (gpointer data);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SecretSession, _secret_session_free)
|
||||
|
||||
const gchar * _secret_session_get_algorithms (SecretSession *session);
|
||||
|
||||
const gchar * _secret_session_get_path (SecretSession *session);
|
||||
|
@ -75,6 +75,8 @@ GVariant * secret_prompt_perform_finish (SecretPrompt *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SecretPrompt, g_object_unref);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __SECRET_PROMPT_H___ */
|
||||
|
@ -72,6 +72,8 @@ void secret_schema_unref (SecretSchema *schema);
|
||||
|
||||
GType secret_schema_attribute_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SecretSchema, g_object_unref);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __SECRET_SCHEMA_H___ */
|
||||
|
@ -304,6 +304,8 @@ gboolean secret_service_set_alias_sync (SecretService
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SecretService, g_object_unref);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __SECRET_SERVICE_H___ */
|
||||
|
@ -51,6 +51,8 @@ SecretValue * secret_value_ref (SecretValue *value);
|
||||
|
||||
void secret_value_unref (gpointer value);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SecretValue, secret_value_unref);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __SECRET_VALUE_H___ */
|
||||
|
Loading…
Reference in New Issue
Block a user