[gvfs/gdbus-core: 38/49] gdbus: Use g_clear_error() where appropriate
- From: Tomas Bzatek <tbzatek src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/gdbus-core: 38/49] gdbus: Use g_clear_error() where appropriate
- Date: Tue, 31 Jul 2012 10:15:39 +0000 (UTC)
commit 6b5b2b4c1f28bdd61e8a2dc24b66191436378910
Author: Tomas Bzatek <tbzatek redhat com>
Date: Mon Jul 23 18:40:24 2012 +0200
gdbus: Use g_clear_error() where appropriate
client/gdaemonfile.c | 7 +++----
client/gdaemonvfs.c | 4 +---
client/gvfsdaemondbus.c | 3 +--
daemon/gvfsdaemon.c | 3 +--
daemon/gvfsjobmount.c | 3 +--
5 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index cef7cb5..bb46b87 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -2767,7 +2767,7 @@ g_daemon_file_set_attribute (GFile *file,
else
if (g_error_matches (my_error, G_VFS_ERROR, G_VFS_ERROR_RETRY))
{
- g_error_free (my_error);
+ g_clear_error (&my_error);
g_object_unref (proxy);
goto retry;
}
@@ -3008,7 +3008,7 @@ retry:
else
if (g_error_matches (my_error, G_VFS_ERROR, G_VFS_ERROR_RETRY))
{
- g_error_free (my_error);
+ g_clear_error (&my_error);
g_object_unref (proxy);
goto retry;
}
@@ -3545,8 +3545,7 @@ find_enclosing_mount_cb (GMountInfo *mount_info,
out:
_g_simple_async_result_complete_with_cancellable (data->result, data->cancellable);
- if (my_error)
- g_error_free (my_error);
+ g_clear_error (&my_error);
g_clear_object (&data->cancellable);
g_object_unref (data->file);
g_object_unref (data->result);
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index 8be8959..a2bcebc 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -887,9 +887,7 @@ async_get_mount_info_response (GVfsDBusMountTracker *proxy,
g_mount_info_unref (info);
g_variant_unref (iter_mount);
-
- if (error)
- g_error_free (error);
+ g_clear_error (&error);
}
free_get_mount_info_data (data);
diff --git a/client/gvfsdaemondbus.c b/client/gvfsdaemondbus.c
index 3ed9fd4..c2cdb24 100644
--- a/client/gvfsdaemondbus.c
+++ b/client/gvfsdaemondbus.c
@@ -300,8 +300,7 @@ async_call_finish (AsyncDBusCall *async_call)
g_clear_object (&async_call->connection);
g_clear_object (&async_call->cancellable);
- if (async_call->io_error)
- g_error_free (async_call->io_error);
+ g_clear_error (&async_call->io_error);
g_free (async_call);
}
diff --git a/daemon/gvfsdaemon.c b/daemon/gvfsdaemon.c
index d2ac22b..bbf3e66 100644
--- a/daemon/gvfsdaemon.c
+++ b/daemon/gvfsdaemon.c
@@ -416,8 +416,7 @@ re_register_jobs_cb (GVfsDBusMountTracker *proxy,
res,
&error);
g_debug ("re_register_jobs_cb, error: %p\n", error);
- if (error)
- g_error_free (error);
+ g_clear_error (&error);
}
static void
diff --git a/daemon/gvfsjobmount.c b/daemon/gvfsjobmount.c
index 1cd9e28..da72444 100644
--- a/daemon/gvfsjobmount.c
+++ b/daemon/gvfsjobmount.c
@@ -177,8 +177,7 @@ register_mount_callback (GVfsDBusMountTracker *proxy,
g_vfs_job_emit_finished (G_VFS_JOB (op_job));
}
- if (error != NULL)
- g_error_free (error);
+ g_clear_error (&error);
}
/* Might be called on an i/o thread */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]