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.
Mathias Gumz akira@fluxbox.org
1 files changed,
3 insertions(+),
3 deletions(-)
jump to
M
src/Screen.cc
→
src/Screen.cc
@@ -797,9 +797,9 @@ void BScreen::removeIcon(FluxboxWindow *w) {
if (w == 0) return; - Icons::iterator erase_it = remove_if(iconList().begin(), - iconList().end(), - bind2nd(equal_to<FluxboxWindow *>(), w)); + Icons::iterator erase_it = find_if(iconList().begin(), + iconList().end(), + bind2nd(equal_to<FluxboxWindow *>(), w)); // no need to send iconlist signal if we didn't // change the iconlist if (erase_it != m_icon_list.end()) {