diff options
-rw-r--r-- | lib/bluetooth-client-private.h | 5 | ||||
-rw-r--r-- | lib/bluetooth-client.c | 9 | ||||
-rw-r--r-- | wizard/main.c | 1 |
3 files changed, 10 insertions, 5 deletions
diff --git a/lib/bluetooth-client-private.h b/lib/bluetooth-client-private.h index 5c0ea754..63f292e9 100644 --- a/lib/bluetooth-client-private.h +++ b/lib/bluetooth-client-private.h @@ -36,7 +36,10 @@ DBusGProxy *bluetooth_client_get_default_adapter(BluetoothClient *client); gboolean bluetooth_client_start_discovery(BluetoothClient *client); gboolean bluetooth_client_stop_discovery(BluetoothClient *client); -typedef void (*BluetoothClientCreateDeviceFunc) (BluetoothClient *client, const char *path, gpointer data); +typedef void (*BluetoothClientCreateDeviceFunc) (BluetoothClient *client, + const char *path, + const GError *error, + gpointer data); gboolean bluetooth_client_create_device(BluetoothClient *client, const char *address, const char *agent, diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c index 33f86a5a..3a0b15ab 100644 --- a/lib/bluetooth-client.c +++ b/lib/bluetooth-client.c @@ -1365,13 +1365,14 @@ static void create_device_callback(DBusGProxy *proxy, dbus_g_proxy_end_call(proxy, call, &error, DBUS_TYPE_G_OBJECT_PATH, &path, G_TYPE_INVALID); - if (error != NULL) { + if (error != NULL) path = NULL; - g_error_free(error); - } if (devdata->func) - devdata->func(devdata->client, path, devdata->data); + devdata->func(devdata->client, path, error, devdata->data); + + if (error != NULL) + g_error_free (error); g_object_unref (devdata->client); g_object_unref(proxy); diff --git a/wizard/main.c b/wizard/main.c index 83260ed9..f26541df 100644 --- a/wizard/main.c +++ b/wizard/main.c @@ -364,6 +364,7 @@ connect_callback (BluetoothClient *_client, static void create_callback (BluetoothClient *_client, const char *path, + const GError *error, gpointer user_data) { ConnectData *data; |