aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-11 23:28:01 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-11 23:28:01 +0800
commitadacbe4f6ef767063a0727368de48cecef1f8fb6 (patch)
treeadd4bc6607d7fdf49faf735554be26e1b23d7430
parent02cc95c188b9b29e91b0e6ffae5325c20b10377a (diff)
parent4e2b40828d4f8c7fd4cbaf27ff345ce2adb4ffcf (diff)
downloadgsoc2013-empathy-adacbe4f6ef767063a0727368de48cecef1f8fb6.tar
gsoc2013-empathy-adacbe4f6ef767063a0727368de48cecef1f8fb6.tar.gz
gsoc2013-empathy-adacbe4f6ef767063a0727368de48cecef1f8fb6.tar.bz2
gsoc2013-empathy-adacbe4f6ef767063a0727368de48cecef1f8fb6.tar.lz
gsoc2013-empathy-adacbe4f6ef767063a0727368de48cecef1f8fb6.tar.xz
gsoc2013-empathy-adacbe4f6ef767063a0727368de48cecef1f8fb6.tar.zst
gsoc2013-empathy-adacbe4f6ef767063a0727368de48cecef1f8fb6.zip
Merge remote branch 'lfrb/ft-cancel'
-rw-r--r--libempathy/empathy-tp-file.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c
index fe010041c..3ad81af62 100644
--- a/libempathy/empathy-tp-file.c
+++ b/libempathy/empathy-tp-file.c
@@ -93,6 +93,7 @@ typedef struct {
EmpathyTpFileOperationCallback op_callback;
gpointer op_user_data;
+ gboolean is_closing;
gboolean is_closed;
gboolean dispose_run;
@@ -241,15 +242,17 @@ splice_stream_ready_cb (GObject *source,
gpointer user_data)
{
EmpathyTpFile *tp_file;
+ EmpathyTpFilePriv *priv;
GError *error = NULL;
tp_file = user_data;
+ priv = GET_PRIV (tp_file);
g_output_stream_splice_finish (G_OUTPUT_STREAM (source), res, &error);
DEBUG ("Splice stream ready cb, error %p", error);
- if (error != NULL)
+ if (error != NULL && !priv->is_closing)
{
ft_operation_close_with_error (tp_file, error);
g_clear_error (&error);
@@ -591,7 +594,7 @@ file_read_async_cb (GObject *source,
in_stream = g_file_read_finish (G_FILE (source), res, &error);
- if (error != NULL)
+ if (error != NULL && !priv->is_closing)
{
ft_operation_close_with_error (tp_file, error);
g_clear_error (&error);
@@ -674,6 +677,8 @@ close_channel_internal (EmpathyTpFile *tp_file,
DEBUG ("Closing channel, should cancel %s", cancel ?
"True" : "False");
+ priv->is_closing = TRUE;
+
tp_cli_channel_call_close (priv->channel, -1,
channel_closed_cb, GINT_TO_POINTER (cancel), NULL, G_OBJECT (tp_file));
}