From 07f1ca42d2322ba613f5141c2efee7c730931919 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 12 Aug 2013 21:04:55 +0200 Subject: [PATCH] Uncompressed blocks are now flushed before compressed blocks. --- library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index c9fe8fa6..133a6ef8 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -435,8 +435,14 @@ namespace PolyVox void LargeVolume::flushAll() { typename CompressedBlockMap::iterator i; + //Replaced the for loop here as the call to //eraseBlock was invalidating the iterator. + while(m_pUncompressedBlockCache.size() > 0) + { + eraseBlock(m_pUncompressedBlockCache.begin()); + } + while(m_pBlocks.size() > 0) { eraseBlock(m_pBlocks.begin());