Add coffeecatch to Map::run()
This commit is contained in:
@@ -35,7 +35,8 @@ enum class Event : uint8_t {
|
||||
Image,
|
||||
OpenGL,
|
||||
JNI,
|
||||
Android
|
||||
Android,
|
||||
Crash
|
||||
};
|
||||
|
||||
MBGL_DEFINE_ENUM_CLASS(EventClass, Event, {
|
||||
@@ -52,6 +53,7 @@ MBGL_DEFINE_ENUM_CLASS(EventClass, Event, {
|
||||
{ Event::OpenGL, "OpenGL" },
|
||||
{ Event::JNI, "JNI" },
|
||||
{ Event::Android, "Android" },
|
||||
{ Event::Android, "Crash" },
|
||||
{ Event(-1), "Unknown" },
|
||||
});
|
||||
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
|
||||
#include <uv.h>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <coffeecatch/coffeecatch.h>
|
||||
#endif
|
||||
|
||||
// Check libuv library version.
|
||||
const static bool uv_version_check = []() {
|
||||
const unsigned int version = uv_version();
|
||||
@@ -251,6 +255,10 @@ void Map::resume() {
|
||||
}
|
||||
|
||||
void Map::run() {
|
||||
#ifdef __ANDROID__
|
||||
COFFEE_TRY() {
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (!async) {
|
||||
map_thread = main_thread;
|
||||
@@ -280,6 +288,12 @@ void Map::run() {
|
||||
map_thread = -1;
|
||||
#endif
|
||||
}
|
||||
#ifdef __ANDROID__
|
||||
} COFFEE_CATCH() {
|
||||
Log::Error(Event::Crash, "Map::run() crash:\n%s", coffeecatch_get_message());
|
||||
abort();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Map::check_for_pause() {
|
||||
|
||||
Reference in New Issue
Block a user