Remove All Memory leaks

This commit is contained in:
Bram Verhulst
2024-05-02 14:57:47 +02:00
parent b6be73019f
commit 77784a167e
8 changed files with 56 additions and 102 deletions

View File

@@ -12,8 +12,21 @@ GroundTileTypeManager* GroundTileTypeManager::GetInstance() {
return m_pInstance;
}
void GroundTileTypeManager::DestroyInstance() {
delete m_pInstance->AIR;
delete m_pInstance->DIRT;
delete m_pInstance->STONE;
delete m_pInstance->LAVA;
delete m_pInstance->IRON;
delete m_pInstance->BRONZE;
delete m_pInstance->GOLD;
delete m_pInstance->HARD_LEFT;
delete m_pInstance->HARD_RIGHT;
delete m_pInstance->HARD_MIDDLE;
delete m_pInstance->GRASS;
delete m_pInstance;
}
GroundTileTypeManager::GroundTileTypeManager(): AIR(new GroundTileType("", GroundTileTypes::Air)), DIRT(new RandomGroundTile("tiles/dirt/dirt[0].png", GroundTileTypes::Dirt, 5)){
GroundTileTypeManager::GroundTileTypeManager() {
}
// void GroundTileTypeManager::Initialize() {
// AIR = new GroundTileType("", GroundTileTypes::Air);