forked from qt-creator/qt-creator
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: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user