From 56996cc01ae82dbdb40b1e720b91092d93247e25 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Thu, 1 Dec 2022 16:43:23 +0000 Subject: [PATCH] WS30 - Clear WS30 data on tile unload Previously WS30 data from STG files - in particular road/rail/river data - was kept permanently. This change unloads it with the STG-level tile. This is the right level to do so, as it will be reloaded from tile when the STG file is loaded again. --- src/Scenery/tilemgr.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 7a94bb3f7..97637b277 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -497,6 +498,11 @@ void FGTileMgr::update_queues(bool& isDownloadingScenery) tile_cache.clear_entry(drop_index); + if (_use_vpb) { + // Clear out any VPB data - e.g. roads + simgear::VPBTechnique::unloadFeatures(old->get_tile_bucket()); + } + osg::ref_ptr subgraph = old->getNode(); old->removeFromSceneGraph(); delete old;