[gnome-bluetooth/gnome-3-0] lib: Fix possible warning in debug output



commit 5d1537e187408c189e18393cff99945bb914bb1c
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Apr 12 16:04:39 2011 +0100

    lib: Fix possible warning in debug output
    
    Getting the EnumClass for BluetoothStatus failed in some cases,
    so hold onto an instance of the class when a BluetoothClient
    instance exists.

 lib/bluetooth-client.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index e32ee38..f347fe4 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -1290,6 +1290,8 @@ static void bluetooth_client_finalize(GObject *client)
 
 	DBG("client %p", client);
 
+	g_type_class_unref (g_type_class_peek (BLUETOOTH_TYPE_STATUS));
+
 	g_signal_handlers_disconnect_by_func(priv->dbus,
 					name_owner_changed, client);
 	g_object_unref(priv->dbus);
@@ -1317,6 +1319,8 @@ static void bluetooth_client_class_init(BluetoothClientClass *klass)
 
 	DBG("class %p", klass);
 
+	g_type_class_ref (BLUETOOTH_TYPE_STATUS);
+
 	g_type_class_add_private(klass, sizeof(BluetoothClientPrivate));
 
 	object_class->finalize = bluetooth_client_finalize;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]