Compare commits
No commits in common. "c725dd78146ade11676e88d16c3e32513a1e0c16" and "eaad08d462cc916a211456f44d363e26a119c94a" have entirely different histories.
c725dd7814
...
eaad08d462
2 changed files with 9 additions and 22 deletions
|
@ -404,12 +404,6 @@ static int api_hexchat_hook_print(lua_State *L)
|
|||
lua_pushvalue(L, 2);
|
||||
ref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||
pri = luaL_optinteger(L, 3, HEXCHAT_PRI_NORM);
|
||||
/* we rely on Close Context pri=INT_MIN for internal stuff. this avoids issues. */
|
||||
if (pri == INT_MIN && strcmp(event, "Close Context"))
|
||||
{
|
||||
hexchat_print(ph, "Warning: Attempted to hook Close Context with priority INT_MIN. Adjusting to INT_MIN+1.");
|
||||
pri = INT_MIN + 1;
|
||||
}
|
||||
info = g_new(hook_info, 1);
|
||||
info->state = L;
|
||||
info->ref = ref;
|
||||
|
|
|
@ -541,13 +541,10 @@ static int
|
|||
plugin_hook_run (session *sess, char *name, char *word[], char *word_eol[],
|
||||
hexchat_event_attrs *attrs, int type)
|
||||
{
|
||||
/* fix segfault https://github.com/hexchat/hexchat/issues/2265 */
|
||||
static int depth = 0;
|
||||
GSList *list, *next;
|
||||
hexchat_hook *hook;
|
||||
int ret, eat = 0;
|
||||
|
||||
depth++;
|
||||
list = hook_list;
|
||||
while (1)
|
||||
{
|
||||
|
@ -593,22 +590,18 @@ plugin_hook_run (session *sess, char *name, char *word[], char *word_eol[],
|
|||
}
|
||||
|
||||
xit:
|
||||
depth--;
|
||||
if (!depth)
|
||||
/* really remove deleted hooks now */
|
||||
list = hook_list;
|
||||
while (list)
|
||||
{
|
||||
/* really remove deleted hooks now */
|
||||
list = hook_list;
|
||||
while (list)
|
||||
hook = list->data;
|
||||
next = list->next;
|
||||
if (!hook || hook->type == HOOK_DELETED)
|
||||
{
|
||||
hook = list->data;
|
||||
next = list->next;
|
||||
if (!hook || hook->type == HOOK_DELETED)
|
||||
{
|
||||
hook_list = g_slist_remove (hook_list, hook);
|
||||
g_free (hook);
|
||||
}
|
||||
list = next;
|
||||
hook_list = g_slist_remove (hook_list, hook);
|
||||
g_free (hook);
|
||||
}
|
||||
list = next;
|
||||
}
|
||||
|
||||
return eat;
|
||||
|
|
Loading…
Add table
Reference in a new issue