summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-02-05 17:43:34 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-02-05 17:43:34 +0800
commiteb34f2a434e42da502e90461490d21ebc9f74aaf (patch)
treeb4b1f4d7e3bbdce0d6e338ba1a122a650799c7e6
parent3680d5ce42b8bb2ebb31a4ab30824b3411fc19c1 (diff)
downloadstackswitch-eb34f2a434e42da502e90461490d21ebc9f74aaf.tar.gz
stackswitch-eb34f2a434e42da502e90461490d21ebc9f74aaf.tar.bz2
Decrement iterator before removing
-rw-r--r--src/stackswitch.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/stackswitch.cpp b/src/stackswitch.cpp
index a313b18..23bdc21 100644
--- a/src/stackswitch.cpp
+++ b/src/stackswitch.cpp
@@ -1199,9 +1199,9 @@ StackswitchScreen::windowRemove (Window id)
while (it != mWindows.begin ())
{
- //CompWindow *w = *it;
+ CompWindow *cw = *it;
- if (w && id == (*it)->id ())
+ if (w && id == cw->id ())
{
inList = true;
@@ -1210,7 +1210,7 @@ StackswitchScreen::windowRemove (Window id)
if (it < mWindows.end ()--)
{
it++;
- selected = (*(it))->id ();
+ selected = cw->id ();
it--;
}
else
@@ -1219,11 +1219,12 @@ StackswitchScreen::windowRemove (Window id)
mSelectedWindow = selected;
}
- mWindows.erase (it); // ???
+ it--;
+
+ mWindows.remove (cw); // ???
break;
}
- it--;
}
if (!inList)