diff options
-rw-r--r-- | platform/android/src/image.cpp | 7 | ||||
-rw-r--r-- | platform/android/src/text/local_glyph_rasterizer.cpp | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/platform/android/src/image.cpp b/platform/android/src/image.cpp index 2a33944b18..0456381578 100644 --- a/platform/android/src/image.cpp +++ b/platform/android/src/image.cpp @@ -16,7 +16,12 @@ PremultipliedImage decodeImage(const std::string& string) { reinterpret_cast<const signed char*>(string.data())); auto bitmap = android::BitmapFactory::DecodeByteArray(*env, array, 0, string.size()); - return android::Bitmap::GetImage(*env, bitmap); + jni::DeleteLocalRef(*env, array); + + auto image = android::Bitmap::GetImage(*env, bitmap); + jni::DeleteLocalRef(*env, bitmap); + + return image; } } // namespace mbgl diff --git a/platform/android/src/text/local_glyph_rasterizer.cpp b/platform/android/src/text/local_glyph_rasterizer.cpp index ce1b0fc8fd..d232058d15 100644 --- a/platform/android/src/text/local_glyph_rasterizer.cpp +++ b/platform/android/src/text/local_glyph_rasterizer.cpp @@ -46,6 +46,7 @@ PremultipliedImage LocalGlyphRasterizer::drawGlyphBitmap(const std::string& font jniFontFamily, static_cast<jni::jboolean>(bold), static_cast<jni::jchar>(glyphID)); + jni::DeleteLocalRef(*env, jniFontFamily); PremultipliedImage result = Bitmap::GetImage(*env, javaBitmap); jni::DeleteLocalRef(*env, javaBitmap); |