From 8a41cecf01287b43fe16895404f589c8004e05b4 Mon Sep 17 00:00:00 2001 From: Shamus Young Date: Wed, 6 May 2009 11:15:15 +0000 Subject: [PATCH] Fixed memory leak with Light Strips. (Streetlights) --- Deco.cpp | 12 ++++++++++++ Deco.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Deco.cpp b/Deco.cpp index 9511fc6..d290a13 100644 --- a/Deco.cpp +++ b/Deco.cpp @@ -31,6 +31,18 @@ #include "world.h" #include "visible.h" + +/*----------------------------------------------------------------------------- + +-----------------------------------------------------------------------------*/ + +CDeco::~CDeco () +{ + + delete _mesh; + +} + /*----------------------------------------------------------------------------- -----------------------------------------------------------------------------*/ diff --git a/Deco.h b/Deco.h index 01245ae..01875dc 100644 --- a/Deco.h +++ b/Deco.h @@ -4,7 +4,6 @@ class CDeco : CEntity { -// CDeco* _next; GLrgba _color; class CMesh* _mesh; int _type; @@ -14,6 +13,7 @@ class CDeco : CEntity public: CDeco (); + ~CDeco (); void CreateLogo (GLvector2 start, GLvector2 end, float base, int seed, GLrgba color); void CreateLightStrip (float x, float z, float width, float depth, float height, GLrgba color); void CreateLightTrim (GLvector* chain, int count, float height, int seed, GLrgba color);