From 6606fbc98e1c15a716252b356d5d49be74527b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Borgese?= Date: Tue, 20 May 2008 21:17:49 +0000 Subject: [PATCH] Fix errors reported by valgind fix mismtch new[]/delete[] fix acces to deleted object. svn path=/trunk/KDE/kdebase/workspace/; revision=810487 --- effects/wobblywindows.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/effects/wobblywindows.cpp b/effects/wobblywindows.cpp index 6f27e7d9c1..dbedb5934f 100644 --- a/effects/wobblywindows.cpp +++ b/effects/wobblywindows.cpp @@ -621,14 +621,14 @@ void WobblyWindowsEffect::initWobblyInfo(WindowWobblyInfos& wwi, QRect geometry) void WobblyWindowsEffect::freeWobblyInfo(WindowWobblyInfos& wwi) const { - delete wwi.origin; - delete wwi.position; - delete wwi.velocity; - delete wwi.acceleration; - delete wwi.buffer; - delete wwi.constraint; + delete[] wwi.origin; + delete[] wwi.position; + delete[] wwi.velocity; + delete[] wwi.acceleration; + delete[] wwi.buffer; + delete[] wwi.constraint; - delete wwi.bezierSurface; + delete[] wwi.bezierSurface; } WobblyWindowsEffect::Pair WobblyWindowsEffect::computeBezierPoint(const WindowWobblyInfos& wwi, Pair point) const @@ -1175,12 +1175,12 @@ bool WobblyWindowsEffect::updateWindowWobblyDatas(EffectWindow* w, qreal time) if (wwi.status != Moving && acc_sum < m_stopAcceleration && vel_sum < m_stopVelocity) { - freeWobblyInfo(wwi); - windows.remove(w); if (wwi.status == Closing) { w->unrefWindow(); } + freeWobblyInfo(wwi); + windows.remove(w); return false; }