summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_msg_buttonsbar.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-30 21:37:39 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-30 21:37:39 +0000
commit5c89906040b2ea1f307f3e337655a9429b858207 (patch)
treebda0c674c82f26b154de6a063d0124d6c8906619 /plugins/MirLua/src/m_msg_buttonsbar.cpp
parentce1c33a2c65a605929c5fcc7c075c76c3b27ea68 (diff)
MirLua: common code moved to m_core.h
git-svn-id: http://svn.miranda-ng.org/main/trunk@14465 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_msg_buttonsbar.cpp')
-rw-r--r--plugins/MirLua/src/m_msg_buttonsbar.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/MirLua/src/m_msg_buttonsbar.cpp b/plugins/MirLua/src/m_msg_buttonsbar.cpp
index 4d969fdfa6..a570fdd620 100644
--- a/plugins/MirLua/src/m_msg_buttonsbar.cpp
+++ b/plugins/MirLua/src/m_msg_buttonsbar.cpp
@@ -67,9 +67,6 @@ static int lua_ModifyButton(lua_State *L)
INT_PTR res = ::CallService(MS_BB_MODIFYBUTTON, 0, (LPARAM)bbb);
lua_pushinteger(L, res);
- mir_free(bbb->pszModuleName);
- mir_free(bbb->ptszTooltip);
-
return 1;
}
@@ -101,6 +98,9 @@ static int lua_OnMsgToolBarLoaded(lua_State *L)
HANDLE res = ::HookEventObjParam(ME_MSG_TOOLBARLOADED, CMLua::HookEventObjParam, L, ref);
lua_pushlightuserdata(L, res);
+ Hooks.insert(res);
+ HookRefs.insert(new HandleRefParam(L, res, ref));
+
return 1;
}
@@ -134,8 +134,6 @@ int ButtonPressedHookEventObjParam(void *obj, WPARAM wParam, LPARAM lParam, LPAR
int res = (int)lua_tointeger(L, 1);
- //luaL_unref(L, LUA_REGISTRYINDEX, ref);
-
return res;
}
@@ -153,6 +151,9 @@ static int lua_OnMsgToolBarButtonPressed(lua_State *L)
HANDLE res = ::HookEventObjParam(ME_MSG_BUTTONPRESSED, ButtonPressedHookEventObjParam, L, ref);
lua_pushlightuserdata(L, res);
+ Hooks.insert(res);
+ HookRefs.insert(new HandleRefParam(L, res, ref));
+
return 1;
}