Valgrind reported effect_window is accessed through Toplevel::discardWindowPixmap() after it has been deleted in Deleted destructor.

Set it to NULL to avoid illegal access.
CCMAIL l.lunak@kde.org

svn path=/trunk/KDE/kdebase/workspace/; revision=810520
This commit is contained in:
Cédric Borgese 2008-05-20 22:01:49 +00:00
parent 7536e368ff
commit daecb8f0fa
2 changed files with 8 additions and 1 deletions

View file

@ -37,7 +37,7 @@ Deleted::~Deleted()
{
assert( delete_refcount == 0 );
workspace()->removeDeleted( this, Allowed );
delete effectWindow();
deleteEffectWindow();
}
Deleted* Deleted::create( Toplevel* c )

View file

@ -141,6 +141,7 @@ class Toplevel
void copyToDeleted( Toplevel* c );
void disownDataPassedToDeleted();
friend kdbgstream& operator<<( kdbgstream& stream, const Toplevel* );
void deleteEffectWindow();
QRect geom;
Visual* vis;
int bit_depth;
@ -393,6 +394,12 @@ inline pid_t Toplevel::pid() const
return info->pid();
}
inline void Toplevel::deleteEffectWindow()
{
delete effect_window;
effect_window = NULL;
}
kdbgstream& operator<<( kdbgstream& stream, const Toplevel* );
kdbgstream& operator<<( kdbgstream& stream, const ToplevelList& );
kdbgstream& operator<<( kdbgstream& stream, const ConstToplevelList& );