From 1c5e411bf9ae705b240cc36c3102f66324c98001 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 13 Jul 2004 06:47:37 +0000 Subject: [PATCH] fix memleak --- stepmania/src/RageSurface.cpp | 10 ++++++++++ stepmania/src/RageSurface.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/stepmania/src/RageSurface.cpp b/stepmania/src/RageSurface.cpp index 7deade915e..e1302d6ca5 100644 --- a/stepmania/src/RageSurface.cpp +++ b/stepmania/src/RageSurface.cpp @@ -38,6 +38,16 @@ int32_t RageSurfacePalette::FindClosestColor( const RageSurfaceColor &color ) co return iBest; } +RageSurfaceFormat::RageSurfaceFormat() +{ + palette = NULL; +} + +RageSurfaceFormat::~RageSurfaceFormat() +{ + delete palette; +} + void RageSurfaceFormat::GetRGB( uint32_t val, uint8_t *r, uint8_t *g, uint8_t *b ) const { if( BytesPerPixel == 1 ) diff --git a/stepmania/src/RageSurface.h b/stepmania/src/RageSurface.h index 34d18a94fa..b30159cdaa 100644 --- a/stepmania/src/RageSurface.h +++ b/stepmania/src/RageSurface.h @@ -26,6 +26,9 @@ struct RageSurfacePalette struct RageSurfaceFormat { + RageSurfaceFormat(); + ~RageSurfaceFormat(); + int32_t BytesPerPixel; int32_t BitsPerPixel; uint32_t Rmask, Gmask, Bmask, Amask;