From 69ae4ca599df6a5de249b2214c839bcac2e2feba Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Mon, 22 Oct 2007 15:03:42 +0000 Subject: Plugged memory leak in particle engine. --- ChangeLog | 4 ++++ src/particle.cpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6cbd1249..d77170f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-10-22 Guillaume Melquiond + + * src/particle.cpp: Plugged memory leak. + 2007-10-21 Guillaume Melquiond * src/gui/window.cpp, src/gui/window.h: Removed redundant resizable diff --git a/src/particle.cpp b/src/particle.cpp index cdd6af41..0f116b15 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -240,6 +240,7 @@ Particle::addEffect(const std::string &particleEffectFile, { logger->log("Warning: %s is not a valid particle effect definition file!", particleEffectFile.c_str()); + xmlFreeDoc(doc); return NULL; } @@ -299,6 +300,8 @@ Particle::addEffect(const std::string &particleEffectFile, mChildParticles.push_back(newParticle); } + xmlFreeDoc(doc); + return newParticle; } -- cgit v1.2.3-70-g09d2