From 3cbadf42a5e1728284450d4f51eeea165075482f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 11 Apr 2019 11:34:52 +0200 Subject: [PATCH] java/Ref: add move constructor --- src/java/Ref.hxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/java/Ref.hxx b/src/java/Ref.hxx index 37dc50bd8..5b6ab0169 100644 --- a/src/java/Ref.hxx +++ b/src/java/Ref.hxx @@ -34,6 +34,8 @@ #include +#include + #include namespace Java { @@ -56,6 +58,10 @@ namespace Java { assert(env != nullptr); } + LocalRef(LocalRef &&src) noexcept + :env(src.env), + value(std::exchange(src.value, nullptr)) {} + ~LocalRef() noexcept { env->DeleteLocalRef(value); }