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
icc-effect-5.14.5
Thomas Lübking 2012-12-08 14:52:32 +01:00
parent 5faa328f04
commit 77ff44216a
1 changed files with 2 additions and 0 deletions

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));