From 939449050fe9f7f94c3de2277f8a34367b34bbb5 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 16 Dec 2009 18:41:08 +0000 Subject: [PATCH] everytime i look in this file and scoot by these lines i think "uh oh, memory leak?" until i glance a few dozen lines further down; just stick to the idioms svn path=/trunk/KDE/kdelibs/; revision=1063023 --- animator.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/animator.cpp b/animator.cpp index 0b8e6d9bc..6232fd76d 100644 --- a/animator.cpp +++ b/animator.cpp @@ -40,46 +40,40 @@ Plasma::Animation* Animator::create(Animator::Animation type, QObject *parent) Plasma::Animation *result = 0; switch (type) { - case FadeAnimation: - result = new Plasma::FadeAnimation; + result = new Plasma::FadeAnimation(parent); break; case GrowAnimation: - result = new Plasma::GrowAnimation; + result = new Plasma::GrowAnimation(parent); break; case PulseAnimation: - result = new Plasma::PulseAnimation; + result = new Plasma::PulseAnimation(parent); break; case RotationAnimation: - result = new Plasma::RotationAnimation; + result = new Plasma::RotationAnimation(parent); break; case RotationStackedAnimation: - result = new Plasma::RotationStackedAnimation; + result = new Plasma::RotationStackedAnimation(parent); break; case SlideAnimation: - result = new Plasma::SlideAnimation; + result = new Plasma::SlideAnimation(parent); break; case GeometryAnimation: - result = new Plasma::GeometryAnimation; + result = new Plasma::GeometryAnimation(parent); break; case ZoomAnimation: - result = new Plasma::ZoomAnimation; + result = new Plasma::ZoomAnimation(parent); break; default: kDebug() << "Unsupported animation type."; - - } - - if (result) { - result->setParent(parent); } return result;