[evolution/webkit: 188/196] Fix some memory leaks
- From: Dan VrÃtil <dvratil src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/webkit: 188/196] Fix some memory leaks
- Date: Tue, 27 Mar 2012 16:16:31 +0000 (UTC)
commit 4e4ac152fce8a3ee01ee950988b8f8d458cb0156
Author: Dan VrÃtil <dvratil redhat com>
Date: Wed Mar 21 16:05:26 2012 +0100
Fix some memory leaks
mail/e-mail-display.c | 1 +
mail/e-mail-reader.c | 4 ++++
mail/e-mail-request.c | 14 ++++----------
3 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index 8629414..e2edd2e 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -770,6 +770,7 @@ bind_attachment_iframe_visibility (GObject *object,
button_uri = g_strconcat (frame_name, ".attachment_button", NULL);
button_element = find_element_by_id (document, button_uri);
+ g_free (button_uri);
if (!button_element)
return;
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 480031c..de5e5e2 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -3041,6 +3041,8 @@ formatter_weak_ref_cb (struct _formatter_weak_ref_closure *data,
g_hash_table_remove (data->formatters,
data->mail_uri);
+ d(printf("Destroying formatter %p (%s)\n", formatter, data->mail_uri));
+
/* Destroying the formatter will prevent this callback
* being called, so we can remove the closure data as well */
g_hash_table_unref (data->formatters);
@@ -3068,6 +3070,8 @@ format_parser_async_done_cb (GObject *source,
g_object_unref (closure->display);
g_free (closure);
+ g_object_unref (result);
+
/* Remove the reference added when formatter was created,
* so that only owners are EMailDisplays */
g_object_unref (emf);
diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c
index 5b62e36..ceb0a6c 100644
--- a/mail/e-mail-request.c
+++ b/mail/e-mail-request.c
@@ -30,7 +30,6 @@ struct _EMailRequestPrivate {
GHashTable *uri_query;
- gchar *ret_data;
gchar *ret_mime_type;
};
@@ -103,7 +102,8 @@ handle_mail_request (GSimpleAsyncResult *res,
});
}
- stream = g_memory_input_stream_new_from_data ((gchar*) ba->data, ba->len, NULL);
+ stream = g_memory_input_stream_new_from_data (
+ (gchar*) ba->data, ba->len, NULL);
g_simple_async_result_set_op_res_gpointer (res, stream, NULL);
}
@@ -128,10 +128,9 @@ handle_file_request (GSimpleAsyncResult *res,
request->priv->mime_type = g_content_type_guess (uri->path, NULL, 0, NULL);
request->priv->content_length = length;
- stream = g_memory_input_stream_new_from_data (contents, length, NULL);
+ stream = g_memory_input_stream_new_from_data (
+ contents, length, (GDestroyNotify) g_free);
g_simple_async_result_set_op_res_gpointer (res, stream, NULL);
-
- request->priv->ret_data = contents;
}
}
@@ -466,11 +465,6 @@ mail_request_finalize (GObject *object)
request->priv->ret_mime_type = NULL;
}
- if (request->priv->ret_data) {
- g_free (request->priv->ret_data);
- request->priv->ret_data = NULL;
- }
-
G_OBJECT_CLASS (e_mail_request_parent_class)->finalize (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]