invalidate old shade_below before searching a new

for the search could be implicitly skipped and we end up
with a dangeling pointer

BUG: 311340
FIXED-IN: 4.10
This commit is contained in:
Thomas Lübking 2012-12-08 14:52:32 +01:00
parent 5faa328f04
commit 77ff44216a

View file

@ -983,6 +983,8 @@ void Client::setShade(ShadeMode mode)
setActive(true);
if (shade_mode == ShadeHover) {
ToplevelList order = workspace()->stackingOrder();
// invalidate, since "this" could be the topmost toplevel and shade_below dangeling
shade_below = NULL;
// this is likely related to the index parameter?!
for (int idx = order.indexOf(this) + 1; idx < order.count(); ++idx) {
shade_below = qobject_cast<Client*>(order.at(idx));