Don't crash when physically removing a device

This commit is contained in:
David Sansome 2010-09-18 13:54:23 +00:00
parent ce1e7f73df
commit 44f0934fed
1 changed files with 2 additions and 2 deletions

View File

@ -459,10 +459,10 @@ void DeviceManager::PhysicalDeviceRemoved(const QString &id) {
if (info.device_ && info.device_->lister() == lister)
info.device_.reset();
emit dataChanged(index(i, 0), index(i, 0));
if (!info.device_)
emit DeviceDisconnected(i);
emit dataChanged(index(i, 0), index(i, 0));
} else {
// If this was the last lister for the device then remove it from the model
for (int backend_index = 0 ; backend_index < info.backends_.count() ; ++backend_index) {