- Don't leak memory; the "slot" string is allocated with qstrdup() with uses

new[] internally.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=740217
This commit is contained in:
Frerich Raabe 2007-11-22 20:30:24 +00:00
parent 0b0a4fc8fa
commit 64a2b7bd9a

View File

@ -342,7 +342,7 @@ void Phase::stopCustomAnimation(AnimId id)
{ {
QMap<AnimId, CustomAnimationState*>::iterator it = d->customAnims.find(id); QMap<AnimId, CustomAnimationState*>::iterator it = d->customAnims.find(id);
if (it != d->customAnims.end()) { if (it != d->customAnims.end()) {
delete it.value()->slot; delete [] it.value()->slot;
delete it.value(); delete it.value();
d->customAnims.erase(it); d->customAnims.erase(it);
} }
@ -540,7 +540,7 @@ void Phase::timerEvent(QTimerEvent *event)
} else { } else {
QMetaObject::invokeMethod(state->receiver, state->slot, Q_ARG(qreal, 1)); QMetaObject::invokeMethod(state->receiver, state->slot, Q_ARG(qreal, 1));
d->customAnims.erase(d->customAnims.find(state->id)); d->customAnims.erase(d->customAnims.find(state->id));
delete state->slot; delete [] state->slot;
delete state; delete state;
} }
} else { } else {