]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
LuaWrapper: Don't move function since we still access it later
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 27 Mar 2018 12:20:21 +0000 (14:20 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 27 Mar 2018 12:20:21 +0000 (14:20 +0200)
ext/luawrapper/include/LuaContext.hpp

index abe432523b8f1a65bd5d4998ce366bc2b5daab2d..6eb2e7b77ffebc7d88f053065ca5a4e8b9fc4074 100644 (file)
@@ -1140,7 +1140,7 @@ private:
         static_assert(std::is_class<TObject>::value || std::is_pointer<TObject>::value || std::is_union<TObject>::value , "registerFunction can only be used for a class a union or a pointer");
 
         checkTypeRegistration(mState, &typeid(TObject));
-        setTable<TRetValue(TObject&, TOtherParams...)>(mState, Registry, &typeid(TObject), 0, functionName, std::move(function));
+        setTable<TRetValue(TObject&, TOtherParams...)>(mState, Registry, &typeid(TObject), 0, functionName, function);
         
         checkTypeRegistration(mState, &typeid(TObject*));
         setTable<TRetValue(TObject*, TOtherParams...)>(mState, Registry, &typeid(TObject*), 0, functionName, [=](TObject* obj, TOtherParams... rest) { assert(obj); return function(*obj, std::forward<TOtherParams>(rest)...); });