Skip to content

Commit

Permalink
Fix segfault caused by a8e238e
Browse files Browse the repository at this point in the history
  • Loading branch information
celeron55 committed Aug 13, 2015
1 parent a8e238e commit def274a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1499,8 +1499,8 @@ void Map::timerUpdate(float dtime, float unload_timeout, u32 max_loaded_blocks,
}
block_count_all = mapblock_queue.size();
// Delete old blocks, and blocks over the limit from the memory
while (mapblock_queue.size() > max_loaded_blocks
|| mapblock_queue.top().block->getUsageTimer() > unload_timeout) {
while (!mapblock_queue.empty() && (mapblock_queue.size() > max_loaded_blocks
|| mapblock_queue.top().block->getUsageTimer() > unload_timeout)) {
TimeOrderedMapBlock b = mapblock_queue.top();
mapblock_queue.pop();

Expand Down

0 comments on commit def274a

Please sign in to comment.