From 533a0aa0576ed31f1840c099267a34330952c4e8 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 28 Dec 2015 19:08:23 +0000 Subject: MirLua: minor changes git-svn-id: http://svn.miranda-ng.org/main/trunk@15960 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/mlua_script.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'plugins/MirLua/src/mlua_script.cpp') diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp index f2deb2ff27..3ddbbd8a15 100644 --- a/plugins/MirLua/src/mlua_script.cpp +++ b/plugins/MirLua/src/mlua_script.cpp @@ -42,11 +42,8 @@ bool CMLuaScript::Load() return false; } - if (lua_pcall(L, 0, 1, 0)) - { - CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)lua_tostring(L, -1)); + if (luaM_pcall(L)) return false; - } isLoaded = true; @@ -56,10 +53,7 @@ bool CMLuaScript::Load() lua_pushliteral(L, "Load"); lua_gettable(L, -2); if (lua_isfunction(L, -1)) - { - if (lua_pcall(L, 0, 0, 0)) - CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)lua_tostring(L, -1)); - } + luaM_pcall(L); else lua_pop(L, 1); @@ -80,8 +74,8 @@ void CMLuaScript::Unload() if (isLoaded && unloadRef) { lua_rawgeti(L, LUA_REGISTRYINDEX, unloadRef); - if (lua_isfunction(L, -1) && lua_pcall(L, 0, 0, 0)) - CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)lua_tostring(L, -1)); + if (lua_isfunction(L, -1)) + luaM_pcall(L); luaL_unref(L, LUA_REGISTRYINDEX, unloadRef); isLoaded = false; } -- cgit v1.2.3