summaryrefslogtreecommitdiff
path: root/platform/android/src/style/sources/image_source.cpp
diff options
context:
space:
mode:
authorŁukasz Paczos <lukas.paczos@gmail.com>2019-02-28 16:45:38 +0100
committerŁukasz Paczos <lukas.paczos@gmail.com>2019-03-05 15:48:33 +0100
commit81f7f2d66c68c198515e64ca64412e429b04f4c6 (patch)
treef1a8e31cd7d167e78fa9478d781e20b1e03980e6 /platform/android/src/style/sources/image_source.cpp
parent05026b704adcbe97c923989b3e2e46feb4fdc7ee (diff)
downloadqtlocation-mapboxgl-upstream/lp-detached-13521.tar.gz
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));
}