From bb6f25c84e1e80c37140173721d6b45ec9148cdc Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 7 Jul 2017 10:27:07 +0200 Subject: [PATCH] LuaWrapper: Don't move the content of vectors, maps and unordered_maps They might hold shared pointers, and moving them cause the source to become empty. luawrapper f9c686e2fa3ad5cf5593265dda491239e32e2955 --- ext/luawrapper/include/LuaContext.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index 9416c906c3..d0ffe6f6be 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -2607,7 +2607,7 @@ struct LuaContext::Reader>> return {}; } - result.push_back({ std::move(val1.get()), std::move(val2.get()) }); + result.push_back({ val1.get(), val2.get() }); lua_pop(state, 1); // we remove the value but keep the key for the next iteration } catch(...) { @@ -2645,7 +2645,7 @@ struct LuaContext::Reader> return {}; } - result.insert({ std::move(key.get()), std::move(value.get()) }); + result.insert({ key.get(), value.get() }); lua_pop(state, 1); // we remove the value but keep the key for the next iteration } catch(...) { @@ -2683,7 +2683,7 @@ struct LuaContext::Reader> return {}; } - result.insert({ std::move(key.get()), std::move(value.get()) }); + result.insert({ key.get(), value.get() }); lua_pop(state, 1); // we remove the value but keep the key for the next iteration } catch(...) { -- 2.47.2