From 46830f1ea5e1054d35466731345e8b1f2b5dd380 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 15 Mar 2016 12:45:07 -0700 Subject: [core] Assert and guard against null std::exception_ptr in toString We don't expect toString to be called with a null std::exception_ptr. But if it is, we'd prefer not to terminate the process in release builds. --- include/mbgl/util/string.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/mbgl/util/string.hpp b/include/mbgl/util/string.hpp index 6c2433534e..51ee848f22 100644 --- a/include/mbgl/util/string.hpp +++ b/include/mbgl/util/string.hpp @@ -28,6 +28,12 @@ inline std::string toString(uint8_t num) { } inline std::string toString(std::exception_ptr error) { + assert(error); + + if (!error) { + return "(null)"; + } + try { std::rethrow_exception(error); } catch (const std::exception& ex) { -- cgit v1.2.1 From 7b5a1ca1670a0346cdbf2af689fabde4e70ed561 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 29 Mar 2016 16:07:10 -0700 Subject: [core] Localize and simplify state for MapChangeDidFinishLoadingMap event Only Map needs to track this state, and it can simply be set when beginning to load a style and reset when finished. --- include/mbgl/map/map.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 463bee7938..3b8cea83a8 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -205,6 +205,7 @@ private: }; RenderState renderState = RenderState::never; + bool loading = false; }; } // namespace mbgl -- cgit v1.2.1