Commit 403f41ef authored by Christian Kandeler's avatar Christian Kandeler

Fix potential assertion when removing Android device.

The device manager does not like it when you remove non-existing
devices.

Change-Id: Ied1b28963a0513761c9cf247c414e0ea29dc8086
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 4a45c1c1
...@@ -703,12 +703,11 @@ void AndroidConfigurations::load() ...@@ -703,12 +703,11 @@ void AndroidConfigurations::load()
void AndroidConfigurations::updateAndroidDevice() void AndroidConfigurations::updateAndroidDevice()
{ {
ProjectExplorer::DeviceManager * const devMgr = ProjectExplorer::DeviceManager::instance();
if (adbToolPath().toFileInfo().exists()) if (adbToolPath().toFileInfo().exists())
ProjectExplorer::DeviceManager::instance() devMgr->addDevice(ProjectExplorer::IDevice::Ptr(new Internal::AndroidDevice));
->addDevice(ProjectExplorer::IDevice::Ptr(new Internal::AndroidDevice)); else if (devMgr->find(Constants::ANDROID_DEVICE_ID))
else devMgr->removeDevice(Core::Id(Constants::ANDROID_DEVICE_ID));
ProjectExplorer::DeviceManager::instance()
->removeDevice(Core::Id(Constants::ANDROID_DEVICE_ID));
} }
AndroidConfigurations *AndroidConfigurations::m_instance = 0; AndroidConfigurations *AndroidConfigurations::m_instance = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment