From d4f16a8dca3ba3e6bf0a4e0dfcdf133a03ba8c2e Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Mon, 23 Feb 2009 14:24:20 +0000 Subject: [PATCH] Why doesn't my system crash when deleting uninitialized data? In unrelated news the fade effect is broken again... This time it prevents windows from ever being deleted. This commit message wins the "most unrelated" award. BUG: 185239 svn path=/trunk/KDE/kdebase/workspace/; revision=930448 --- effects/presentwindows/presentwindows.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index 5c2f5fcc9a..329f214308 100644 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -249,6 +249,8 @@ void PresentWindowsEffect::paintWindow( EffectWindow *w, int mask, QRegion regio void PresentWindowsEffect::windowAdded( EffectWindow *w ) { + if( !m_activated ) + return; m_windowData[w].visible = isVisibleWindow( w ); m_windowData[w].opacity = 0.0; m_windowData[w].highlight = 0.0; @@ -269,21 +271,22 @@ void PresentWindowsEffect::windowAdded( EffectWindow *w ) void PresentWindowsEffect::windowClosed( EffectWindow *w ) { + if( !m_activated ) + return; if( m_highlightedWindow == w ) setHighlightedWindow( findFirstWindow() ); m_windowData[w].visible = false; // TODO: Fix this so they do actually fade out - rearrangeWindows(); } void PresentWindowsEffect::windowDeleted( EffectWindow *w ) { - if( m_windowData.contains( w )) - { - delete m_windowData[w].textFrame; - delete m_windowData[w].iconFrame; - m_windowData.remove( w ); - } + if( !m_activated ) + return; + delete m_windowData[w].textFrame; + delete m_windowData[w].iconFrame; + m_windowData.remove( w ); m_motionManager.unmanage( w ); + rearrangeWindows(); } bool PresentWindowsEffect::borderActivated( ElectricBorder border )