Ensure the watcher never leaks

This commit is contained in:
Aleix Pol 2015-03-14 04:27:30 +01:00
parent 9c45c5469c
commit fb9143a2aa

View file

@ -136,6 +136,7 @@ void DevicesModel::refreshDeviceList()
void DevicesModel::receivedDeviceList(QDBusPendingCallWatcher* watcher)
{
watcher->deleteLater();
clearDevices();
QDBusPendingReply<QStringList> pendingDeviceIds = *watcher;
if (pendingDeviceIds.isError()) {
@ -150,7 +151,6 @@ void DevicesModel::receivedDeviceList(QDBusPendingCallWatcher* watcher)
m_deviceList.append(new DeviceDbusInterface(id, this));
}
endInsertRows();
watcher->deleteLater();
}
void DevicesModel::clearDevices()