Skip to content

Commit def274a

Browse files
committedAug 13, 2015
Fix segfault caused by a8e238e
1 parent a8e238e commit def274a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

Diff for: ‎src/map.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1499,8 +1499,8 @@ void Map::timerUpdate(float dtime, float unload_timeout, u32 max_loaded_blocks,
14991499
}
15001500
block_count_all = mapblock_queue.size();
15011501
// Delete old blocks, and blocks over the limit from the memory
1502-
while (mapblock_queue.size() > max_loaded_blocks
1503-
|| mapblock_queue.top().block->getUsageTimer() > unload_timeout) {
1502+
while (!mapblock_queue.empty() && (mapblock_queue.size() > max_loaded_blocks
1503+
|| mapblock_queue.top().block->getUsageTimer() > unload_timeout)) {
15041504
TimeOrderedMapBlock b = mapblock_queue.top();
15051505
mapblock_queue.pop();
15061506

0 commit comments

Comments
 (0)
Please sign in to comment.