diff options
author | Corey Berla <corey@berla.me> | 2022-07-31 21:38:40 -0700 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2022-08-04 22:30:38 +0000 |
commit | c504ca5fefc3be002e27e30f247c0cbe41752c6b (patch) | |
tree | 0a9fb93dfd02f3262cfa0b9486a92f2fdc27db6c /src | |
parent | 151d482dff874a904f66ce878ad77445e08d925f (diff) | |
download | nautilus-c504ca5fefc3be002e27e30f247c0cbe41752c6b.tar.gz |
dbus-launcher: Store error message rather than GError
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-dbus-launcher.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nautilus-dbus-launcher.c b/src/nautilus-dbus-launcher.c index 743b18a37..99c0b28c8 100644 --- a/src/nautilus-dbus-launcher.c +++ b/src/nautilus-dbus-launcher.c @@ -15,7 +15,7 @@ typedef struct { GDBusProxy *proxy; - GError *error; + gchar *error; GCancellable *cancellable; gboolean ping_on_creation; } NautilusDBusLauncherData; @@ -59,11 +59,15 @@ on_nautilus_dbus_launcher_ping_finished (GObject *source_object, gpointer user_data) { NautilusDBusLauncherData *data = user_data; - GError *error = NULL; + g_autoptr (GError) error = NULL; g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, &error); - data->error = error; + if (error != NULL) + { + data->error = g_strdup (error->message); + } + g_clear_object (&data->cancellable); } @@ -100,14 +104,14 @@ on_nautilus_dbus_proxy_ready (GObject *source_object, gpointer user_data) { NautilusDBusLauncherData *data = user_data; - GError *error = NULL; + g_autoptr (GError) error = NULL; data->proxy = g_dbus_proxy_new_for_bus_finish (res, &error); if (error != NULL) { g_warning ("Error creating proxy %s", error->message); - data->error = error; + data->error = g_strdup (error->message); g_clear_object (&data->cancellable); } else if (data->ping_on_creation) @@ -169,7 +173,7 @@ nautilus_dbus_launcher_finalize (GObject *object) for (gint i = 1; i <= self->last_app_initialized; i++) { g_clear_object (&self->data[i]->proxy); - g_clear_object (&self->data[i]->error); + g_free (self->data[i]->error); g_cancellable_cancel (self->data[i]->cancellable); g_clear_object (&self->data[i]->cancellable); g_free (self->data[i]); |