Avoid crashes during shutdown.
svn path=/trunk/KDE/kdebase/workspace/; revision=662929
This commit is contained in:
parent
d83256ae1f
commit
d1b6aaacdf
4 changed files with 10 additions and 4 deletions
|
@ -47,11 +47,16 @@ void Deleted::copyToDeleted( Toplevel* c )
|
|||
cinfo->disable();
|
||||
}
|
||||
|
||||
void Deleted::unrefWindow()
|
||||
void Deleted::unrefWindow( bool delay )
|
||||
{
|
||||
if( --delete_refcount > 0 )
|
||||
return;
|
||||
deleteLater();
|
||||
// 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;
|
||||
}
|
||||
|
||||
int Deleted::desktop() const
|
||||
|
|
|
@ -24,7 +24,7 @@ class Deleted
|
|||
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();
|
||||
void unrefWindow( bool delay = false );
|
||||
virtual int desktop() const;
|
||||
protected:
|
||||
virtual void debug( kdbgstream& stream ) const;
|
||||
|
|
|
@ -791,7 +791,7 @@ void EffectWindowImpl::refWindow()
|
|||
void EffectWindowImpl::unrefWindow()
|
||||
{
|
||||
if( Deleted* d = dynamic_cast< Deleted* >( toplevel ))
|
||||
return d->unrefWindow();
|
||||
return d->unrefWindow( true ); // delayed
|
||||
abort(); // TODO
|
||||
}
|
||||
|
||||
|
|
1
main.cpp
1
main.cpp
|
@ -153,6 +153,7 @@ Application::~Application()
|
|||
|
||||
void Application::lostSelection()
|
||||
{
|
||||
sendPostedEvents();
|
||||
delete Workspace::self();
|
||||
// remove windowmanager privileges
|
||||
XSelectInput(display(), rootWindow(), PropertyChangeMask );
|
||||
|
|
Loading…
Reference in a new issue