Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
libkscreen
Commits
2df014f5
Commit
2df014f5
authored
Oct 23, 2020
by
Aleix Pol Gonzalez
🐧
Committed by
Aleix Pol Gonzalez
Oct 29, 2020
Browse files
ConfigMonitor: Properly combine erase and iteration
Otherwise we skip the item right after the removed element
parent
2c1e09a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/configmonitor.cpp
View file @
2df014f5
...
...
@@ -184,10 +184,12 @@ void ConfigMonitor::Private::updateConfigs(const KScreen::ConfigPtr &newConfig)
void
ConfigMonitor
::
Private
::
configDestroyed
(
QObject
*
removedConfig
)
{
for
(
auto
iter
=
watchedConfigs
.
begin
();
iter
!=
watchedConfigs
.
end
();
++
iter
)
{
for
(
auto
iter
=
watchedConfigs
.
begin
();
iter
!=
watchedConfigs
.
end
();
)
{
if
(
iter
->
toStrongRef
()
==
removedConfig
)
{
iter
=
watchedConfigs
.
erase
(
iter
);
// Iterate over the entire list in case there are duplicates
}
else
{
++
iter
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment