[gnome-control-center/gnome-3-6] bluetooth: Simplify ->finalize
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gnome-3-6] bluetooth: Simplify ->finalize
- Date: Thu, 8 Nov 2012 17:56:02 +0000 (UTC)
commit f299846ba76a8c2d712414b9380dc4adfc1a545a
Author: Bastien Nocera <hadess hadess net>
Date: Thu Nov 8 18:36:33 2012 +0100
bluetooth: Simplify ->finalize
panels/bluetooth/cc-bluetooth-panel.c | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
---
diff --git a/panels/bluetooth/cc-bluetooth-panel.c b/panels/bluetooth/cc-bluetooth-panel.c
index 455a21f..3264020 100644
--- a/panels/bluetooth/cc-bluetooth-panel.c
+++ b/panels/bluetooth/cc-bluetooth-panel.c
@@ -97,18 +97,9 @@ cc_bluetooth_panel_finalize (GObject *object)
bluetooth_plugin_manager_cleanup ();
self = CC_BLUETOOTH_PANEL (object);
- if (self->priv->builder) {
- g_object_unref (self->priv->builder);
- self->priv->builder = NULL;
- }
- if (self->priv->killswitch) {
- g_object_unref (self->priv->killswitch);
- self->priv->killswitch = NULL;
- }
- if (self->priv->client) {
- g_object_unref (self->priv->client);
- self->priv->client = NULL;
- }
+ g_clear_object (&self->priv->builder);
+ g_clear_object (&self->priv->killswitch);
+ g_clear_object (&self->priv->client);
g_clear_pointer (&self->priv->connecting_devices, g_hash_table_destroy);
g_clear_pointer (&self->priv->selected_bdaddr, g_free);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]