Use EnvAttachingDeleter for LocalGlyphRasterizer and AssetManagerFileSource (#2487)
This commit is contained in:
@@ -39,7 +39,7 @@ LocalGlyphRasterizer::LocalGlyphRasterizer() {
|
||||
static auto& javaClass = jni::Class<LocalGlyphRasterizer>::Singleton(*env);
|
||||
static auto constructor = javaClass.GetConstructor(*env);
|
||||
|
||||
javaObject = jni::NewGlobal(*env, javaClass.New(*env, constructor));
|
||||
javaObject = jni::NewGlobal<jni::EnvAttachingDeleter>(*env, javaClass.New(*env, constructor));
|
||||
}
|
||||
|
||||
PremultipliedImage LocalGlyphRasterizer::drawGlyphBitmap(const std::string& fontFamily,
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
PremultipliedImage drawGlyphBitmap(const std::string& fontFamily, const bool bold, const char16_t glyphID);
|
||||
|
||||
private:
|
||||
jni::Global<jni::Object<LocalGlyphRasterizer>> javaObject;
|
||||
jni::Global<jni::Object<LocalGlyphRasterizer>, jni::EnvAttachingDeleter> javaObject;
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
||||
Reference in New Issue
Block a user