Minor memory leak patch to present windows.

svn path=/trunk/KDE/kdebase/workspace/; revision=936614
This commit is contained in:
Lucas Murray 2009-03-08 05:07:42 +00:00
parent 358264a828
commit 6d57716d53
2 changed files with 5 additions and 7 deletions

View file

@ -272,17 +272,16 @@ void PresentWindowsEffect::windowAdded( EffectWindow *w )
void PresentWindowsEffect::windowClosed( EffectWindow *w )
{
if( !m_activated )
return;
if( m_highlightedWindow == w )
setHighlightedWindow( findFirstWindow() );
assert( m_windowData.contains( w ));
if( !m_windowData.contains( w ))
return;
m_windowData[w].visible = false; // TODO: Fix this so they do actually fade out
}
void PresentWindowsEffect::windowDeleted( EffectWindow *w )
{
if( !m_activated || !m_windowData.contains( w ))
if( !m_windowData.contains( w ))
return;
delete m_windowData[w].textFrame;
delete m_windowData[w].iconFrame;
@ -1148,6 +1147,8 @@ void PresentWindowsEffect::setActive( bool active, bool closingTab )
// Add every single window to m_windowData (Just calling [w] creates it)
foreach( EffectWindow *w, effects->stackingOrder() )
{
if( m_windowData.contains( w )) // Happens if we reactivate before the ending animation finishes
continue;
m_windowData[w].visible = isVisibleWindow( w );
m_windowData[w].opacity = 0.0;
if( w->isOnCurrentDesktop() && !w->isMinimized() )

View file

@ -26,8 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kwineffects.h>
#include <QPixmap>
namespace KWin
{
@ -48,7 +46,6 @@ class PresentWindowsEffect
double highlight;
int slot;
int slot_distance;
QPixmap icon;
EffectFrame* textFrame;
EffectFrame* iconFrame;
};