diff options
author | Mathias Gumz <akira@fluxbox.org> | 2015-01-22 09:09:08 (GMT) |
---|---|---|
committer | Mathias Gumz <akira@fluxbox.org> | 2015-01-22 09:09:08 (GMT) |
commit | 5428edf3daec57f490518ac356f60cc1a05a3693 (patch) | |
tree | 5b88c07a8b8b5b7bb39fac5e85e7ddf26d822e0b /src | |
parent | 1ec4fb6b6cb6d4b93dddc40c59abf62552445ad2 (diff) | |
download | fluxbox-5428edf3daec57f490518ac356f60cc1a05a3693.zip fluxbox-5428edf3daec57f490518ac356f60cc1a05a3693.tar.bz2 |
Fix removing windows from icon list
std::remove_if() removes an item from a container and returns a
past-the-end iterator ... which equals m_icon_list.end(). As a result
the check
if (erase_it != m_icon_list.end()) {
iconList().erase(erase_it);
iconListSig().emit(*this);
}
will never succeed and thus the iconListSig() will never be emitted.
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 2ae63a1..5e6f38e 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -797,9 +797,9 @@ void BScreen::removeIcon(FluxboxWindow *w) { | |||
797 | if (w == 0) | 797 | if (w == 0) |
798 | return; | 798 | return; |
799 | 799 | ||
800 | Icons::iterator erase_it = remove_if(iconList().begin(), | 800 | Icons::iterator erase_it = find_if(iconList().begin(), |
801 | iconList().end(), | 801 | iconList().end(), |
802 | bind2nd(equal_to<FluxboxWindow *>(), w)); | 802 | bind2nd(equal_to<FluxboxWindow *>(), w)); |
803 | // no need to send iconlist signal if we didn't | 803 | // no need to send iconlist signal if we didn't |
804 | // change the iconlist | 804 | // change the iconlist |
805 | if (erase_it != m_icon_list.end()) { | 805 | if (erase_it != m_icon_list.end()) { |