Commit fb9143a2 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Ensure the watcher never leaks

parent 9c45c546
......@@ -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()
......
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