Commit 296ec4d0 authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

java/Ref: add nullptr check to destructor

May allow the compiler to optimize calls away.
parent 6e58fd15
...@@ -62,6 +62,7 @@ namespace Java { ...@@ -62,6 +62,7 @@ namespace Java {
value(std::exchange(src.value, nullptr)) {} value(std::exchange(src.value, nullptr)) {}
~LocalRef() noexcept { ~LocalRef() noexcept {
if (value != nullptr)
env->DeleteLocalRef(value); env->DeleteLocalRef(value);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment