Fix errors reported by valgind

fix mismtch new[]/delete[]
fix acces to deleted object.

svn path=/trunk/KDE/kdebase/workspace/; revision=810487
This commit is contained in:
Cédric Borgese 2008-05-20 21:17:49 +00:00
parent ed2d087f9b
commit 6606fbc98e

View file

@ -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;
}