talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit b63b8202fe6101437e07e88fd1c0ba1a220ec9c7
parent b5145c1c4e138e6ae0a4731b0192f1c52cac6166
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Fri,  4 Jan 2019 19:50:08 +0100

Make children tracking in execute_actions() more async-aware

We need to update the children count in children->nb
after starting each child process instead of after
starting all of them, because we use that count
in wait_for_children(), which is run asynchronously
for each child.

Fixes bug #3979: Hang (with killing needed) during
action which extracts attachments

Diffstat:
Msrc/action.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/action.c b/src/action.c @@ -840,6 +840,7 @@ static gboolean execute_actions(gchar *action, GSList *msg_list, children = g_new0(Children, 1); + children->nb = 0; children->action = g_strdup(action); children->action_type = action_type; children->msg_text = text; @@ -883,6 +884,7 @@ static gboolean execute_actions(gchar *action, GSList *msg_list, g_slist_append (NULL, msginfo); children_list = g_slist_append(children_list, child_info); + children->nb++; } g_free(cmd); } @@ -896,6 +898,7 @@ static gboolean execute_actions(gchar *action, GSList *msg_list, g_slist_copy (msg_list); children_list = g_slist_append(children_list, child_info); + children->nb++; } g_free(cmd); } else @@ -914,7 +917,6 @@ static gboolean execute_actions(gchar *action, GSList *msg_list, GSList *cur; children->list = children_list; - children->nb = g_slist_length(children_list); children->initial_nb = children->nb; for (cur = children_list; cur; cur = cur->next) { @@ -1094,6 +1096,7 @@ static gint wait_for_children(Children *children) free_children(children); } else if (!children->output) { gtk_widget_destroy(children->dialog); + children->dialog = NULL; } return FALSE;