1
0
Fork 0

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.
This commit is contained in:
Stuart Buchanan 2022-12-01 16:43:23 +00:00
parent ebe511439a
commit 56996cc01a

View file

@ -36,6 +36,7 @@
#include <simgear/structure/exception.hxx>
#include <simgear/scene/model/modellib.hxx>
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <simgear/scene/tgdb/VPBTechnique.hxx>
#include <simgear/scene/tsync/terrasync.hxx>
#include <simgear/misc/strutils.hxx>
#include <simgear/scene/material/matlib.hxx>
@ -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<osg::Object> subgraph = old->getNode();
old->removeFromSceneGraph();
delete old;