Delete the correct item in removeDesktop

Summary:
QList::erase will move the data underneath where the iterator is
pointing, we want to delete the entry we're about to remove from the
list.

Test Plan: Relevant tests now behave better

Reviewers: #kwin, broulik

Reviewed By: broulik

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D16885
This commit is contained in:
David Edmundson 2018-11-15 10:19:25 +00:00
parent 1414e2abcc
commit 8dc537ff0a

View file

@ -246,8 +246,8 @@ void PlasmaVirtualDesktopManagementInterface::removeDesktop(const QString &id)
org_kde_plasma_virtual_desktop_management_send_desktop_removed(*it, id.toUtf8().constData());
}
d->desktops.erase(deskIt);
(*deskIt)->deleteLater();
d->desktops.erase(deskIt);
}
QList <PlasmaVirtualDesktopInterface *> PlasmaVirtualDesktopManagementInterface::desktops() const