diff options
Diffstat (limited to 'platform/glfw/main.cpp')
-rw-r--r-- | platform/glfw/main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/glfw/main.cpp b/platform/glfw/main.cpp index 0a4ace6a19..4e631ec895 100644 --- a/platform/glfw/main.cpp +++ b/platform/glfw/main.cpp @@ -6,6 +6,7 @@ #include <mbgl/util/logging.hpp> #include <mbgl/util/platform.hpp> #include <mbgl/util/default_thread_pool.hpp> +#include <mbgl/util/string.hpp> #include <mbgl/storage/default_file_source.hpp> #include <mbgl/style/style.hpp> #include <mbgl/renderer/renderer.hpp> @@ -159,6 +160,14 @@ int main(int argc, char *argv[]) { isPaused = !isPaused; }); + view->setResetCacheCallback([fileSource] () { + fileSource->resetCache([](std::exception_ptr ex) { + if (ex) { + mbgl::Log::Error(mbgl::Event::Database, "Failed to reset cache:: %s", mbgl::util::toString(ex).c_str()); + } + }); + }); + // Load style if (style.empty()) { const char *url = getenv("MAPBOX_STYLE_URL"); |