diff src/bluetooth/agent.c @ 2882:15754379dbd5

fixed the remove bonding bug and made it thread safe
author Paula Stanciu <paula.stanciu@gmail.com>
date Thu, 07 Aug 2008 20:00:52 +0300
parents 455e6e37feae
children 4128ae5633e4
line wrap: on
line diff
--- a/src/bluetooth/agent.c	Thu Aug 07 17:19:39 2008 +0300
+++ b/src/bluetooth/agent.c	Thu Aug 07 20:00:52 2008 +0300
@@ -762,6 +762,8 @@
 static void bonding_created(DBusGProxy *object,
 				const char *address, gpointer user_data)
 {
+    bonded_dev_mutex = g_mutex_new (); 
+
 	const char *adapter = NULL, *name = NULL;
 	gchar *device, *text;
 
@@ -779,6 +781,10 @@
 			device = g_strdup_printf("%s (%s)", name, address);
 	} else
 		device = g_strdup(address);
+    
+    g_mutex_lock(bonded_dev_mutex);
+    bonded_dev = g_strdup_printf(address);
+    g_mutex_unlock(bonded_dev_mutex);
 
 	text = g_strdup_printf(_("Created bonding with %s"), device);
     bonding_finish = 1;