diff options
Diffstat (limited to 'plugins/MirLua/src/m_msg_buttonsbar.cpp')
-rw-r--r-- | plugins/MirLua/src/m_msg_buttonsbar.cpp | 11 |
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;
}
|