Fix orthophotos not being cleaned up on scenery reload
This commit is contained in:
parent
fa09c3a6e2
commit
4ddc3dc8aa
3 changed files with 4 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue