Streetwalrus Einstein пре 10 година
родитељ
комит
b59cda7002
2 измењених фајлова са 3 додато и 1 уклоњено
  1. 2 0
      src/engine/StateMachine.cpp
  2. 1 1
      src/map/Map.cpp

+ 2 - 0
src/engine/StateMachine.cpp

@@ -19,6 +19,8 @@ STATEMACHINE::StateMachine(State *state)
 
 STATEMACHINE::~StateMachine()
 {
+    while (!stack.empty())
+        pop();
 }
 
 void STATEMACHINE::push(State *state)

+ 1 - 1
src/map/Map.cpp

@@ -22,7 +22,7 @@ MAP::Map(int width, int height, uint16_t *layer0, uint16_t *layer1) : anim()
 
 MAP::~Map()
 {
-    // TODO if you allocate dynamically members
+    delete this->renderer;
 }
 
 void MAP::update(unsigned dt)