Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Fix issue with JNI Env not available #177

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ Image::Image(facebook::jni::alias_ref<JIImage> image)
id_ = wrapObjectMethod(mediaUtilsClass, image)->toStdString();
}

Image::~Image() {
ThreadScope::WithClassLoader([&]() {
Environment::ensureCurrentThreadIsAttached();
this->image_.release();
});
}

std::string Image::getId() const {
return id_;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace media {
class Image : public IImage {
public:
Image(facebook::jni::alias_ref<JIImage> image);
~Image() override = default;
~Image() override;

std::string getId() const override;

Expand Down