[glib] Do not use g_autofree
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Do not use g_autofree
- Date: Wed, 28 Mar 2018 10:52:59 +0000 (UTC)
commit 07731ff3fc6ede1155a690d71b8ae2caedf680ba
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Mar 27 16:06:54 2018 +0100
Do not use g_autofree
The g_auto macros are available only with GCC-compatible compilers on
Unix, but having __attribute__((cleanup)) is not part of our toolchain
requirements, so we shouldn't use it — even if we are building on
Unix-compatible systems.
https://bugzilla.gnome.org/show_bug.cgi?id=794732
gio/gdesktopappinfo.c | 4 +++-
gio/gdocumentportal.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index 26bc53bd5..869bb8feb 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -2886,7 +2886,7 @@ g_desktop_app_info_launch_uris_with_dbus (GDesktopAppInfo *info,
GAppLaunchContext *launch_context)
{
GList *ruris = uris;
- g_autofree char *app_id = NULL;
+ char *app_id = NULL;
g_return_val_if_fail (info != NULL, FALSE);
@@ -2905,6 +2905,8 @@ g_desktop_app_info_launch_uris_with_dbus (GDesktopAppInfo *info,
if (ruris != uris)
g_list_free_full (ruris, g_free);
+ g_free (app_id);
+
return TRUE;
}
diff --git a/gio/gdocumentportal.c b/gio/gdocumentportal.c
index 3e85bd22c..56378b1e6 100644
--- a/gio/gdocumentportal.c
+++ b/gio/gdocumentportal.c
@@ -203,7 +203,7 @@ g_document_portal_add_documents (GList *uris,
{
const char *uri = l->data;
int idx = -1;
- g_autofree char *path = NULL;
+ char *path = NULL;
path = g_filename_from_uri (uri, NULL, NULL);
if (path != NULL)
@@ -221,6 +221,8 @@ g_document_portal_add_documents (GList *uris,
}
}
+ g_free (path);
+
if (idx != -1)
g_variant_builder_add (&builder, "h", idx);
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]