java/Ref: add nullptr check to destructor
May allow the compiler to optimize calls away.
This commit is contained in:
parent
6e58fd1583
commit
296ec4d07c
@ -62,6 +62,7 @@ namespace Java {
|
||||
value(std::exchange(src.value, nullptr)) {}
|
||||
|
||||
~LocalRef() noexcept {
|
||||
if (value != nullptr)
|
||||
env->DeleteLocalRef(value);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user