diff options
author | madmaxoft <github@xoft.cz> | 2014-05-28 16:33:10 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-05-28 16:33:10 +0200 |
commit | d29b242674fbf89035c8908753496522edf8eaee (patch) | |
tree | 75fabddd035865f096fdac598fb946051fab49bf /src/Generating/PrefabPiecePool.cpp | |
parent | Stuff. (diff) | |
download | cuberite-d29b242674fbf89035c8908753496522edf8eaee.tar cuberite-d29b242674fbf89035c8908753496522edf8eaee.tar.gz cuberite-d29b242674fbf89035c8908753496522edf8eaee.tar.bz2 cuberite-d29b242674fbf89035c8908753496522edf8eaee.tar.lz cuberite-d29b242674fbf89035c8908753496522edf8eaee.tar.xz cuberite-d29b242674fbf89035c8908753496522edf8eaee.tar.zst cuberite-d29b242674fbf89035c8908753496522edf8eaee.zip |
Diffstat (limited to '')
-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 ed9340815..145474bcc 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); |