| Index: chrome/browser/chromeos/dbus/bluetooth_agent_service_provider.cc
|
| diff --git a/chrome/browser/chromeos/dbus/bluetooth_agent_service_provider.cc b/chrome/browser/chromeos/dbus/bluetooth_agent_service_provider.cc
|
| index a0b523446c8498530673eda0a44ac3b7219d5866..505a6f425be0d1a491d9219cadd54ae5362d235d 100644
|
| --- a/chrome/browser/chromeos/dbus/bluetooth_agent_service_provider.cc
|
| +++ b/chrome/browser/chromeos/dbus/bluetooth_agent_service_provider.cc
|
| @@ -37,11 +37,12 @@ class BluetoothAgentServiceProviderImpl : public BluetoothAgentServiceProvider {
|
| : weak_ptr_factory_(this),
|
| origin_thread_id_(base::PlatformThread::CurrentId()),
|
| bus_(bus),
|
| - delegate_(delegate) {
|
| + delegate_(delegate),
|
| + object_path_(object_path) {
|
| DVLOG(1) << "Creating BluetoothAdapterClientImpl for "
|
| << object_path.value();
|
|
|
| - exported_object_ = bus_->GetExportedObject(object_path);
|
| + exported_object_ = bus_->GetExportedObject(object_path_);
|
|
|
| exported_object_->ExportMethod(
|
| bluetooth_agent::kBluetoothAgentInterface,
|
| @@ -119,6 +120,8 @@ class BluetoothAgentServiceProviderImpl : public BluetoothAgentServiceProvider {
|
| }
|
|
|
| virtual ~BluetoothAgentServiceProviderImpl() {
|
| + // Unregister the object path so we can reuse with a new agent.
|
| + bus_->UnregisterExportedObject(object_path_);
|
| }
|
|
|
| private:
|
| @@ -522,6 +525,10 @@ class BluetoothAgentServiceProviderImpl : public BluetoothAgentServiceProvider {
|
| // owns this one, and must outlive it.
|
| Delegate* delegate_;
|
|
|
| + // D-Bus object path of object we are exporting, kept so we can unregister
|
| + // again in our destructor.
|
| + dbus::ObjectPath object_path_;
|
| +
|
| // D-Bus object we are exporting, owned by this object.
|
| scoped_refptr<dbus::ExportedObject> exported_object_;
|
|
|
|
|