diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2009-02-19 16:22:48 -0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2009-02-19 16:22:48 -0300 |
commit | e777c55aa7cd84fe63bcdee16acde8d1a293b928 (patch) | |
tree | c2d87d3b6d274fbdd659f5946546120183b8f536 | |
parent | c82739046f031f32e3e66128062818eea2fc9e9e (diff) |
Make use of g_error_free instead of g_clear_error when possible.
g_clear_error make an extra operation (&err = NULL) which is not necessary
when the GError is not reused.
-rw-r--r-- | audio/avdtp.c | 2 | ||||
-rw-r--r-- | audio/manager.c | 4 | ||||
-rw-r--r-- | input/device.c | 4 | ||||
-rw-r--r-- | input/server.c | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/audio/avdtp.c b/audio/avdtp.c index b3ae7bac..bc021d6c 100644 --- a/audio/avdtp.c +++ b/audio/avdtp.c @@ -1852,7 +1852,7 @@ static void avdtp_connect_cb(GIOChannel *chan, GError *err, gpointer user_data) BT_IO_OPT_INVALID); if (gerr) { error("%s", gerr->message); - g_clear_error(&gerr); + g_error_free(gerr); goto failed; } diff --git a/audio/manager.c b/audio/manager.c index 35f9c6e5..d7ecfb40 100644 --- a/audio/manager.c +++ b/audio/manager.c @@ -445,7 +445,7 @@ static void ag_confirm(GIOChannel *chan, gpointer data) BT_IO_OPT_INVALID); if (err) { error("%s", err->message); - g_clear_error(&err); + g_error_free(err); goto drop; } @@ -590,7 +590,7 @@ static int headset_server_init(struct audio_adapter *adapter) failed: error("%s", err->message); - g_clear_error(&err); + g_error_free(err); if (adapter->hsp_ag_server) { g_io_channel_close(adapter->hsp_ag_server); g_io_channel_unref(adapter->hsp_ag_server); diff --git a/input/device.c b/input/device.c index eb089093..4ab7aabc 100644 --- a/input/device.c +++ b/input/device.c @@ -741,7 +741,7 @@ static void control_connect_cb(GIOChannel *chan, GError *conn_err, error("%s", err->message); reply = connection_attempt_failed(iconn->pending_connect, err->message); - g_clear_error(&err); + g_error_free(err); g_io_channel_close(chan); goto failed; } @@ -939,7 +939,7 @@ static DBusMessage *device_connect(DBusConnection *conn, dbus_message_unref(iconn->pending_connect); iconn->pending_connect = NULL; reply = connection_attempt_failed(msg, err->message); - g_clear_error(&err); + g_error_free(err); return reply; } diff --git a/input/server.c b/input/server.c index fdeac6d5..88db485c 100644 --- a/input/server.c +++ b/input/server.c @@ -142,7 +142,7 @@ int server_start(const bdaddr_t *src) BT_IO_OPT_INVALID); if (!ctrl_io) { error("Failed to listen on control channel"); - g_clear_error(&err); + g_error_free(err); return -1; } @@ -154,7 +154,7 @@ int server_start(const bdaddr_t *src) if (!intr_io) { error("Failed to listen on interrupt channel"); g_io_channel_unref(ctrl_io); - g_clear_error(&err); + g_error_free(err); return -1; } |