diff options
author | madmaxoft <github@xoft.cz> | 2014-05-29 09:14:47 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-05-29 09:14:47 +0200 |
commit | b56033d5416306eb71bef9659fee92b368d4436e (patch) | |
tree | 7647fc9b8a29dc5ec0bc7258c68e4a59d113b205 /src/Generating/PrefabPiecePool.cpp | |
parent | Fixed a crash in message formatter. (diff) | |
parent | Cmake system name not System name (diff) | |
download | cuberite-b56033d5416306eb71bef9659fee92b368d4436e.tar cuberite-b56033d5416306eb71bef9659fee92b368d4436e.tar.gz cuberite-b56033d5416306eb71bef9659fee92b368d4436e.tar.bz2 cuberite-b56033d5416306eb71bef9659fee92b368d4436e.tar.lz cuberite-b56033d5416306eb71bef9659fee92b368d4436e.tar.xz cuberite-b56033d5416306eb71bef9659fee92b368d4436e.tar.zst cuberite-b56033d5416306eb71bef9659fee92b368d4436e.zip |
Diffstat (limited to 'src/Generating/PrefabPiecePool.cpp')
-rw-r--r-- | src/Generating/PrefabPiecePool.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Generating/PrefabPiecePool.cpp b/src/Generating/PrefabPiecePool.cpp index ad97ab0e7..122b9d2af 100644 --- a/src/Generating/PrefabPiecePool.cpp +++ b/src/Generating/PrefabPiecePool.cpp @@ -26,6 +26,34 @@ cPrefabPiecePool::cPrefabPiecePool( +cPrefabPiecePool::~cPrefabPiecePool() +{ + Clear(); +} + + + + + +void cPrefabPiecePool::Clear(void) +{ + m_PiecesByConnector.clear(); + for (cPieces::iterator itr = m_AllPieces.begin(), end = m_AllPieces.end(); itr != end; ++itr) + { + delete *itr; + } + m_AllPieces.clear(); + for (cPieces::iterator itr = m_StartingPieces.begin(), end = m_StartingPieces.end(); itr != end; ++itr) + { + delete *itr; + } + m_StartingPieces.clear(); +} + + + + + void cPrefabPiecePool::AddPieceDefs(const cPrefab::sDef * a_PieceDefs, size_t a_NumPieceDefs) { ASSERT(a_PieceDefs != NULL); |