summaryrefslogtreecommitdiff
path: root/platform/android/src/style/sources/image_source.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/style/sources/image_source.cpp')
-rw-r--r--platform/android/src/style/sources/image_source.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/android/src/style/sources/image_source.cpp b/platform/android/src/style/sources/image_source.cpp
index b42e0e5a51..7adc03d794 100644
--- a/platform/android/src/style/sources/image_source.cpp
+++ b/platform/android/src/style/sources/image_source.cpp
@@ -32,6 +32,9 @@ namespace android {
ImageSource::~ImageSource() = default;
void ImageSource::setURL(jni::JNIEnv& env, const jni::String& url) {
+ if (detached) {
+ return;
+ }
// Update the core source
source.as<mbgl::style::ImageSource>()->ImageSource::setURL(jni::Make<std::string>(env, url));
}
@@ -42,10 +45,16 @@ namespace android {
}
void ImageSource::setImage(jni::JNIEnv& env, const jni::Object<Bitmap>& bitmap) {
+ if (detached) {
+ return;
+ }
source.as<mbgl::style::ImageSource>()->setImage(Bitmap::GetImage(env, bitmap));
}
void ImageSource::setCoordinates(jni::JNIEnv& env, const jni::Object<LatLngQuad>& coordinatesObject) {
+ if (detached) {
+ return;
+ }
source.as<mbgl::style::ImageSource>()->setCoordinates(
LatLngQuad::getLatLngArray(env, coordinatesObject));
}