summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp
index db2a46ef8..8ce96bdc5 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -30,6 +30,7 @@
#include "particle.h"
#include "simpleanimation.h"
#include "tileset.h"
+#include "walklayer.h"
#include "resources/ambientlayer.h"
#include "resources/image.h"
@@ -126,6 +127,7 @@ Map::Map(const int width, const int height,
mTileWidth(tileWidth), mTileHeight(tileHeight),
mMaxTileHeight(height),
mMetaTiles(new MetaTile[mWidth * mHeight]),
+ mWalkLayer(nullptr),
mHasWarps(false),
mDebugFlags(MAP_NORMAL),
mOnClosedList(1), mOnOpenList(2),
@@ -187,6 +189,11 @@ Map::~Map()
for (int i = 0; i < NB_BLOCKTYPES; i++)
delete [] mOccupation[i];
+ if (mWalkLayer)
+ {
+ mWalkLayer->decRef();
+ mWalkLayer = nullptr;
+ }
mFringeLayer = nullptr;
delete_all(mLayers);
delete_all(mTilesets);