mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
libs: iterate over a copy of the startups list in TaskManager::killStartup()
because removing item from the list via QList<T>::removeAll() modifies the list Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
5606f97af8
commit
ee0a299d73
1 changed files with 4 additions and 2 deletions
|
@ -423,9 +423,11 @@ void TaskManager::gotStartupChange(const KStartupInfoId& id, const KStartupInfoD
|
|||
|
||||
void TaskManager::killStartup(const KStartupInfoId& id)
|
||||
{
|
||||
foreach (Startup *startup, d->startups) {
|
||||
QMutableListIterator<Startup*> it(d->startups);
|
||||
while (it.hasNext()) {
|
||||
Startup *startup = it.next();
|
||||
if (startup->id() == id) {
|
||||
d->startups.removeAll(startup);
|
||||
it.remove();
|
||||
emit startupRemoved(startup);
|
||||
delete startup;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue