Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

GameControl: don't leak effects

coverity 4437 4438
  • Loading branch information...
commit 282eab5fc56dfcb93da34ebf00fd59774819428c 1 parent 948cfe1
@lynxlynxlynx lynxlynxlynx authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 gemrb/core/GUI/GameControl.cpp
View
5 gemrb/core/GUI/GameControl.cpp
@@ -1022,6 +1022,7 @@ bool GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod)
if (fx) {
core->ApplyEffect(fx, lastActor, lastActor);
}
+ delete fx;
}
break;
case 't'://advances time
@@ -1075,13 +1076,15 @@ bool GameControl::OnKeyRelease(unsigned char Key, unsigned short Mod)
Effect *newfx;
newfx = EffectQueue::CreateEffect(damage_ref, 300, DAMAGE_MAGIC<<16, FX_DURATION_INSTANT_PERMANENT);
core->ApplyEffect(newfx, lastActor, lastActor);
+ delete newfx;
if (! (lastActor->GetInternalFlag() & IF_REALLYDIED)) {
newfx = EffectQueue::CreateEffect(damage_ref, 300, DAMAGE_ACID<<16, FX_DURATION_INSTANT_PERMANENT);
core->ApplyEffect(newfx, lastActor, lastActor);
+ delete newfx;
newfx = EffectQueue::CreateEffect(damage_ref, 300, DAMAGE_CRUSHING<<16, FX_DURATION_INSTANT_PERMANENT);
core->ApplyEffect(newfx, lastActor, lastActor);
+ delete newfx;
}
- delete newfx;
} else if (overContainer) {
overContainer->SetContainerLocked(0);
} else if (overDoor) {

0 comments on commit 282eab5

Please sign in to comment.
Something went wrong with that request. Please try again.