From ca38d9110c49f5066dbb81cc1c66ad4841c7c26e Mon Sep 17 00:00:00 2001 From: Nathaniel Warner Date: Fri, 27 Nov 2020 12:34:49 -0800 Subject: [PATCH] Fix orthophotos not being cleaned up on scenery reload --- simgear/scene/util/OrthophotoManager.cxx | 5 +++++ simgear/scene/util/OrthophotoManager.hxx | 1 + 2 files changed, 6 insertions(+) diff --git a/simgear/scene/util/OrthophotoManager.cxx b/simgear/scene/util/OrthophotoManager.cxx index 4363c55f..14667613 100644 --- a/simgear/scene/util/OrthophotoManager.cxx +++ b/simgear/scene/util/OrthophotoManager.cxx @@ -371,6 +371,11 @@ namespace simgear { } } + void OrthophotoManager::unregisterAll() { + _orthophotos.clear(); + SG_LOG(SG_TERRAIN, SG_INFO, "Unregistered all orthophotos"); + } + OrthophotoRef OrthophotoManager::getOrthophoto(const long bucket_idx) { if (_orthophotos[bucket_idx]) { return _orthophotos[bucket_idx]; diff --git a/simgear/scene/util/OrthophotoManager.hxx b/simgear/scene/util/OrthophotoManager.hxx index 45b7ba28..950be9cf 100644 --- a/simgear/scene/util/OrthophotoManager.hxx +++ b/simgear/scene/util/OrthophotoManager.hxx @@ -91,6 +91,7 @@ namespace simgear { void registerOrthophoto(const long bucket_idx, const OrthophotoRef& orthophoto); void unregisterOrthophoto(const long bucket_idx); + void unregisterAll(); /** * Get an orthophoto by bucket index