always defer delete of Deleted to next event cycle
BUG: 317765 FIXED-IN: 4.11 REVIEW: 110756
This commit is contained in:
parent
abaf6faae1
commit
b8439145bd
3 changed files with 8 additions and 9 deletions
13
deleted.cpp
13
deleted.cpp
|
@ -107,16 +107,15 @@ void Deleted::copyToDeleted(Toplevel* c)
|
|||
}
|
||||
}
|
||||
|
||||
void Deleted::unrefWindow(bool delay)
|
||||
void Deleted::unrefWindow()
|
||||
{
|
||||
if (--delete_refcount > 0)
|
||||
return;
|
||||
// needs to be delayed when calling from effects, otherwise it'd be rather
|
||||
// complicated to handle the case of the window going away during a painting pass
|
||||
if (delay)
|
||||
deleteLater();
|
||||
else
|
||||
delete this;
|
||||
// needs to be delayed
|
||||
// a) when calling from effects, otherwise it'd be rather complicated to handle the case of the
|
||||
// window going away during a painting pass
|
||||
// b) to prevent dangeling pointers in the stacking order, see bug #317765
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
int Deleted::desktop() const
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
static Deleted* create(Toplevel* c);
|
||||
// used by effects to keep the window around for e.g. fadeout effects when it's destroyed
|
||||
void refWindow();
|
||||
void unrefWindow(bool delay = false);
|
||||
void unrefWindow();
|
||||
void discard();
|
||||
virtual int desktop() const;
|
||||
virtual QStringList activities() const;
|
||||
|
|
|
@ -1662,7 +1662,7 @@ void EffectWindowImpl::refWindow()
|
|||
void EffectWindowImpl::unrefWindow()
|
||||
{
|
||||
if (Deleted* d = dynamic_cast< Deleted* >(toplevel))
|
||||
return d->unrefWindow(true); // delayed
|
||||
return d->unrefWindow(); // delays deletion in case
|
||||
abort(); // TODO
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue