Commit 238d78a7 authored by Tomas Popela's avatar Tomas Popela

Composer - Fix various leaks

parent 20c7ddae
......@@ -1371,7 +1371,7 @@ composer_build_message (EMsgComposer *composer,
gboolean pre_encode;
EHTMLEditor *editor;
EHTMLEditorView *view;
GList *inline_images;
GList *inline_images = NULL;
editor = e_msg_composer_get_editor (composer);
view = e_html_editor_get_view (editor);
......@@ -1457,7 +1457,6 @@ composer_build_message (EMsgComposer *composer,
CamelMimePart *part = g_list_nth_data (inline_images, ii);
camel_multipart_add_part (
html_with_images, part);
g_object_unref (part);
}
context->top_level_part =
......@@ -1466,6 +1465,7 @@ composer_build_message (EMsgComposer *composer,
context->top_level_part =
CAMEL_DATA_WRAPPER (body);
}
g_list_free_full (inline_images, g_object_unref);
}
/* If there are attachments, wrap what we've built so far
......@@ -1960,6 +1960,7 @@ msg_composer_drag_data_received_cb (GtkWidget *widget,
do {
text = next_uri ((guchar **) &data, &len, &list_len);
e_html_editor_selection_insert_html (editor_selection, text);
g_free (text);
} while (list_len);
e_html_editor_view_check_magic_links (html_editor_view, FALSE);
......@@ -1995,6 +1996,7 @@ msg_composer_drag_data_received_cb (GtkWidget *widget,
do {
uri = next_uri ((guchar **) &data, &len, &list_len);
e_html_editor_selection_insert_image (editor_selection, uri);
g_free (uri);
} while (list_len);
gtk_drag_finish (context, TRUE, FALSE, time);
......@@ -2017,8 +2019,8 @@ msg_composer_drag_data_received_cb (GtkWidget *widget,
list_len = length;
do {
uri = next_uri ((guchar **) &data, &len, &list_len);
e_html_editor_selection_insert_image (editor_selection, uri);
g_free (uri);
} while (list_len);
gtk_drag_finish (context, TRUE, FALSE, time);
......
......@@ -2858,10 +2858,12 @@ e_html_editor_selection_get_font_color (EHTMLEditorSelection *selection,
document = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view));
body = webkit_dom_document_get_body (document);
g_free (color);
color = webkit_dom_html_body_element_get_text (WEBKIT_DOM_HTML_BODY_ELEMENT (body));
if (!(color && *color)) {
*rgba = black;
g_object_unref (view);
g_free (color);
return;
}
}
......@@ -3013,8 +3015,10 @@ e_html_editor_selection_get_font_size (EHTMLEditorSelection *selection)
E_HTML_EDITOR_SELECTION_FONT_SIZE_NORMAL);
size = get_font_property (selection, "size");
if (!(size && *size))
if (!(size && *size)) {
g_free (size);
return E_HTML_EDITOR_SELECTION_FONT_SIZE_NORMAL;
}
size_int = atoi (size);
g_free (size);
......@@ -4416,6 +4420,7 @@ e_html_editor_selection_set_monospaced (EHTMLEditorSelection *selection,
g_object_unref (range);
g_object_unref (dom_selection);
g_object_unref (dom_window);
g_free (ev);
return;
}
}
......
......@@ -393,6 +393,8 @@ picture_gallery_dispose (GObject *object)
gallery->priv->monitor = NULL;
}
g_free (gallery->priv->path);
/* Chain up to parent's dispose() method. */
G_OBJECT_CLASS (e_picture_gallery_parent_class)->dispose (object);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment