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:
Alex Cristici
2026-04-22 14:03:58 +03:00
committed by GitHub
parent 9f8667cf44
commit 14a81ec831
44 changed files with 295 additions and 85 deletions

View File

@@ -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