summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-05-01 11:15:16 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-05-01 11:15:16 +0200
commit8875c167d7f1e26f2db2a06522806a2ba0e7a6b5 (patch)
tree47e15042e4071c42abb6ec66b460a0d337fefcf5 /src
parent0e86f684a5afd98f213b70c90d5e016478b3b7fd (diff)
downloadweechat-8875c167d7f1e26f2db2a06522806a2ba0e7a6b5.zip
Fix crash with hook_process (when timer is called on a deleted hook process)
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-hook.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c
index 72a0e31a5..2a0384607 100644
--- a/src/core/wee-hook.c
+++ b/src/core/wee-hook.c
@@ -1290,6 +1290,9 @@ hook_process_child_read (struct t_hook *hook_process, int fd,
char buffer[4096];
int num_read;
+ if (hook_process->deleted)
+ return;
+
num_read = read (fd, buffer, sizeof (buffer) - 1);
if (num_read > 0)
{
@@ -1355,6 +1358,9 @@ hook_process_timer_cb (void *arg_hook_process, int remaining_calls)
hook_process = (struct t_hook *)arg_hook_process;
+ if (hook_process->deleted)
+ return WEECHAT_RC_OK;
+
if (remaining_calls == 0)
{
gui_chat_printf (NULL,