Handle allocation failure [Core feature] (#4178)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1656,5 +1656,17 @@ void NativeMapView::onSpriteRequested(const std::optional<style::Sprite>& sprite
|
||||
}
|
||||
}
|
||||
|
||||
void NativeMapView::onRenderError(std::exception_ptr) {
|
||||
assert(vm != nullptr);
|
||||
|
||||
android::UniqueEnv _env = android::AttachEnv();
|
||||
static auto& javaClass = jni::Class<NativeMapView>::Singleton(*_env);
|
||||
static auto onRenderError = javaClass.GetMethod<void()>(*_env, "onRenderError");
|
||||
auto weakReference = javaPeer.get(*_env);
|
||||
if (weakReference) {
|
||||
weakReference.Call(*_env, onRenderError);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace android
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user