summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2016-05-22 10:28:57 +0000
committerfrosch <frosch@openttd.org>2016-05-22 10:28:57 +0000
commit914d4616caf8a407086af95be615bde4d393c0c0 (patch)
tree5eeb5d4d3f417607598700694e10349e5f0a0c9d /src
parentc0c1a4cded52ccb2f197dd4df7e0b1a51fc7c330 (diff)
downloadopenttd-914d4616caf8a407086af95be615bde4d393c0c0.tar.xz
(svn r27575) -Fix [FS#6404]: Memory leak when disabling palette animation. (JGR)
Diffstat (limited to 'src')
-rw-r--r--src/blitter/32bpp_anim.cpp5
-rw-r--r--src/blitter/32bpp_anim.hpp2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/blitter/32bpp_anim.cpp b/src/blitter/32bpp_anim.cpp
index a3083e40b..deedaf34b 100644
--- a/src/blitter/32bpp_anim.cpp
+++ b/src/blitter/32bpp_anim.cpp
@@ -20,6 +20,11 @@
/** Instantiation of the 32bpp with animation blitter factory. */
static FBlitter_32bppAnim iFBlitter_32bppAnim;
+Blitter_32bppAnim::~Blitter_32bppAnim()
+{
+ free(this->anim_buf);
+}
+
template <BlitterMode mode>
inline void Blitter_32bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom)
{
diff --git a/src/blitter/32bpp_anim.hpp b/src/blitter/32bpp_anim.hpp
index e707c4437..a0a022e49 100644
--- a/src/blitter/32bpp_anim.hpp
+++ b/src/blitter/32bpp_anim.hpp
@@ -29,6 +29,8 @@ public:
anim_buf_height(0)
{}
+ ~Blitter_32bppAnim();
+
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);