Clean up MapLayers

This commit is contained in:
def 2020-09-30 23:57:03 +02:00
parent 406d383c45
commit 134400158a
2 changed files with 22 additions and 0 deletions

View file

@ -387,6 +387,27 @@ void mem_copy_special(void *pDest, void *pSource, size_t Size, size_t Count, siz
}
}
CMapLayers::~CMapLayers()
{
//clear everything and destroy all buffers
if(m_TileLayerVisuals.size() != 0)
{
int s = m_TileLayerVisuals.size();
for(int i = 0; i < s; ++i)
{
delete m_TileLayerVisuals[i];
}
}
if(m_QuadLayerVisuals.size() != 0)
{
int s = m_QuadLayerVisuals.size();
for(int i = 0; i < s; ++i)
{
delete m_QuadLayerVisuals[i];
}
}
}
void CMapLayers::OnMapLoad()
{
if(!Graphics()->IsTileBufferingEnabled() && !Graphics()->IsQuadBufferingEnabled())

View file

@ -139,6 +139,7 @@ public:
};
CMapLayers(int Type, bool OnlineOnly = true);
virtual ~CMapLayers();
virtual void OnInit();
virtual void OnRender();
virtual void OnMapLoad();