From db2904e1445bfe09c7ea55e2d67f4e51aeca292f Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 4 May 2007 17:13:50 +0000 Subject: fix infinite loop caused by deiconify command --- ChangeLog | 3 +++ src/FbCommands.cc | 7 +++++-- src/Window.cc | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca435eb..b6aba3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0.0: +*07/05/04: + * Fixed infinite loop caused by deiconify command (Mark) + FbCommands.cc *07/04/24: * Fixed a bug in parsing cli (Mathias, thanks to Steven Kah Hien Wong for pointing out the issue) diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 060f4d3..afa7984 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -394,8 +394,11 @@ void DeiconifyCmd::execute() { if (screen == 0) return; - BScreen::Icons::reverse_iterator it= screen->iconList().rbegin(); - BScreen::Icons::reverse_iterator itend= screen->iconList().rend(); + // we need to make a copy of the list of icons, or else our iterator can + // become invalid + BScreen::Icons icon_list = screen->iconList(); + BScreen::Icons::iterator it = icon_list.begin(); + BScreen::Icons::iterator itend= icon_list.end(); unsigned int workspace_num= screen->currentWorkspaceID(); unsigned int old_workspace_num; diff --git a/src/Window.cc b/src/Window.cc index 066d962..24fc8df 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -458,7 +458,7 @@ void FluxboxWindow::init() { restoreAttributes(); - if (m_workspace_number < 0 || m_workspace_number >= screen().numberOfWorkspaces()) + if (m_workspace_number >= screen().numberOfWorkspaces()) m_workspace_number = screen().currentWorkspaceID(); bool place_window = (m_old_pos_x == static_cast(m_screen.width())); -- cgit v0.11.2