diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2016-05-27 13:59:38 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2016-05-27 13:59:38 +0000 |
commit | 51fa76a3b307fb8ddaf2e086723489d1b2d2655d (patch) | |
tree | 27ed3c774a42aca3ae24de8d7d0148d554647e94 | |
parent | db10ee4ebb7f047c72f70828c89c95d62ee482cd (diff) |
MirLua: fix MT::Set method
git-svn-id: http://svn.miranda-ng.org/main/trunk@16875 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/MirLua/src/m_protocols.cpp | 2 | ||||
-rw-r--r-- | plugins/MirLua/src/mlua_metatable.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/MirLua/src/m_protocols.cpp b/plugins/MirLua/src/m_protocols.cpp index 5bcc6a829d..dd3db59833 100644 --- a/plugins/MirLua/src/m_protocols.cpp +++ b/plugins/MirLua/src/m_protocols.cpp @@ -99,7 +99,7 @@ static int lua_AccountIterator(lua_State *L) {
int i = lua_tointeger(L, lua_upvalueindex(1));
int count = lua_tointeger(L, lua_upvalueindex(2));
- PROTOACCOUNT** accounts = (PROTOACCOUNT**)lua_touserdata(L, lua_upvalueindex(3));
+ PROTOACCOUNT **accounts = (PROTOACCOUNT**)lua_touserdata(L, lua_upvalueindex(3));
if (i < count)
{
diff --git a/plugins/MirLua/src/mlua_metatable.h b/plugins/MirLua/src/mlua_metatable.h index 6e8ddc3cf5..deb4c66cef 100644 --- a/plugins/MirLua/src/mlua_metatable.h +++ b/plugins/MirLua/src/mlua_metatable.h @@ -193,8 +193,8 @@ public: return;
}
- T *udata = (T*)lua_newuserdata(L, sizeof(T));
- memcpy(udata, obj, sizeof(T));
+ T **udata = (T**)lua_newuserdata(L, sizeof(T));
+ *udata = obj;
luaL_setmetatable(L, MT::name);
}
};
|