summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-03-13 15:47:43 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-03-13 15:47:43 +0100
commit881e23643166d7519969f6ab53dda2231035fbc1 (patch)
treed9f9274973db95d33ad3e7de809703e9ec6f970e
parent030993a8c749d05731003d265de72155b304ea23 (diff)
parent10259fa5d3b5dddc3b2202a36e4b6b621890fab1 (diff)
Merge remote-tracking branch 'origin/master' into next
-rw-r--r--telepathy-glib/contact.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index f59bd75fa..ee9a8c651 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -2085,10 +2085,11 @@ mime_file_written (GObject *source_object,
}
else
{
+ gchar *data_path = g_file_get_path (avatar_data->file);
+
DEBUG ("Saved avatar '%s' of MIME type '%s' still used by '%s' to '%s'",
avatar_data->token, avatar_data->mime_type,
- self->priv->identifier,
- g_file_get_path (avatar_data->file));
+ self->priv->identifier, data_path);
g_clear_object (&self->priv->avatar_file);
self->priv->avatar_file = g_object_ref (avatar_data->file);
@@ -2101,6 +2102,7 @@ mime_file_written (GObject *source_object,
g_object_notify ((GObject *) self, "avatar-file");
g_object_unref (self);
+ g_free (data_path);
}
write_avatar_data_free (avatar_data);
@@ -2114,26 +2116,29 @@ avatar_file_written (GObject *source_object,
GError *error = NULL;
WriteAvatarData *avatar_data = user_data;
GFile *file = G_FILE (source_object);
+ gchar *path = g_file_get_path (file);
g_assert (file == avatar_data->file);
if (!g_file_replace_contents_finish (file, res, NULL, &error))
{
DEBUG ("Failed to store avatar in cache (%s): %s",
- g_file_get_path (file), error->message);
+ path, error->message);
DEBUG ("Storing the MIME type anyway");
g_clear_error (&error);
}
else
{
DEBUG ("Contact avatar stored in cache: %s",
- g_file_get_path (file));
+ path);
}
g_file_replace_contents_async (avatar_data->mime_file,
avatar_data->mime_type, strlen (avatar_data->mime_type),
NULL, FALSE, G_FILE_CREATE_PRIVATE|G_FILE_CREATE_REPLACE_DESTINATION,
NULL, mime_file_written, avatar_data);
+
+ g_free (path);
}
static void