1
0
Fork 0

Fix orthophotos not being cleaned up on scenery reload

This commit is contained in:
Nathaniel Warner 2020-11-27 12:34:40 -08:00 committed by Scott Giese
parent fa09c3a6e2
commit 4ddc3dc8aa
3 changed files with 4 additions and 1 deletions

View file

@ -84,7 +84,7 @@ void TileEntry::_create_orthophoto() {
}
void TileEntry::_free_orthophoto() {
if (_orthophoto) {
if (_orthophoto && tile_bucket.isValid()) {
simgear::OrthophotoManager::instance()->unregisterOrthophoto(tile_bucket.gen_index());
}
}

View file

@ -180,6 +180,8 @@ void FGTileMgr::reinit()
SG_LOG( SG_TERRAIN, SG_INFO, "Initializing Tile Manager subsystem." );
auto terraSync = globals->get_subsystem<simgear::SGTerraSync>();
simgear::OrthophotoManager::instance()->unregisterAll();
// drops the previous options reference
_options = new simgear::SGReaderWriterOptions;
_listener.reset(new TileManagerListener(this));

View file

@ -27,6 +27,7 @@
#include <simgear/compiler.h>
#include <simgear/bucket/newbucket.hxx>
#include <simgear/scene/util/OrthophotoManager.hxx>
#include "SceneryPager.hxx"
#include "tilecache.hxx"