[file-roller: 37/123] process: disconnect from the cancellable before completing
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller: 37/123] process: disconnect from the cancellable before completing
- Date: Mon, 6 Aug 2012 13:43:58 +0000 (UTC)
commit 8d1c9e73f7ad9a8d20e1e8b6c0aeac4171c63263
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Jul 21 00:23:45 2012 +0200
process: disconnect from the cancellable before completing
src/fr-process.c | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
---
diff --git a/src/fr-process.c b/src/fr-process.c
index 4676895..95210e2 100644
--- a/src/fr-process.c
+++ b/src/fr-process.c
@@ -665,11 +665,6 @@ execute_cancelled_cb (GCancellable *cancellable,
if (process->priv->stopping)
return;
- if (exec_data->cancel_id != 0) {
- g_cancellable_disconnect (exec_data->cancellable, exec_data->cancel_id);
- exec_data->cancel_id = 0;
- }
-
process->priv->stopping = TRUE;
exec_data->error = fr_error_new (FR_ERROR_STOPPED, 0, NULL);
@@ -691,6 +686,10 @@ execute_cancelled_cb (GCancellable *cancellable,
process->priv->running = FALSE;
+ if (exec_data->cancel_id != 0) {
+ g_signal_handler_disconnect (exec_data->cancellable, exec_data->cancel_id);
+ exec_data->cancel_id = 0;
+ }
g_simple_async_result_complete_in_idle (exec_data->result);
}
}
@@ -743,6 +742,17 @@ _fr_process_get_charset (FrProcess *process)
}
+static void
+_fr_process_execute_complete_in_idle (ExecuteData *exec_data)
+{
+ if (exec_data->cancel_id != 0) {
+ g_cancellable_disconnect (exec_data->cancellable, exec_data->cancel_id);
+ exec_data->cancel_id = 0;
+ }
+ g_simple_async_result_complete_in_idle (exec_data->result);
+}
+
+
static gint
check_child (gpointer data)
{
@@ -890,7 +900,7 @@ check_child (gpointer data)
exec_data->first_error_stderr = NULL;
}
- g_simple_async_result_complete_in_idle (exec_data->result);
+ _fr_process_execute_complete_in_idle (exec_data);
return FALSE;
}
@@ -951,7 +961,7 @@ execute_current_command (ExecuteData *exec_data)
&error))
{
exec_data->error = fr_error_new (FR_ERROR_SPAWN, 0, error);
- g_simple_async_result_complete_in_idle (exec_data->result);
+ _fr_process_execute_complete_in_idle (exec_data);
g_error_free (error);
g_free (argv);
@@ -992,7 +1002,7 @@ _fr_process_start (ExecuteData *exec_data)
if (process->priv->n_comm == -1) {
process->priv->running = FALSE;
- g_simple_async_result_complete_in_idle (exec_data->result);
+ _fr_process_execute_complete_in_idle (exec_data);
}
else {
process->priv->running = TRUE;
@@ -1032,7 +1042,7 @@ fr_process_execute (FrProcess *process,
if (g_cancellable_set_error_if_cancelled (cancellable, &error)) {
exec_data->error = fr_error_new (FR_ERROR_STOPPED, 0, error);
- g_simple_async_result_complete_in_idle (exec_data->result);
+ _fr_process_execute_complete_in_idle (exec_data);
g_error_free (error);
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]