aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Meeks <mmeeks@src.gnome.org>2000-03-28 05:33:34 +0800
committerMichael Meeks <mmeeks@src.gnome.org>2000-03-28 05:33:34 +0800
commit7b379b8f3b59bafc137054a66ffd40a1e5908971 (patch)
treeb0340aaf3844743e209efa6559aafb429e3cea90
parente3219d0bb2d2b1baac480b95b57bfeacf8afa777 (diff)
downloadgsoc2013-evolution-7b379b8f3b59bafc137054a66ffd40a1e5908971.tar
gsoc2013-evolution-7b379b8f3b59bafc137054a66ffd40a1e5908971.tar.gz
gsoc2013-evolution-7b379b8f3b59bafc137054a66ffd40a1e5908971.tar.bz2
gsoc2013-evolution-7b379b8f3b59bafc137054a66ffd40a1e5908971.tar.lz
gsoc2013-evolution-7b379b8f3b59bafc137054a66ffd40a1e5908971.tar.xz
gsoc2013-evolution-7b379b8f3b59bafc137054a66ffd40a1e5908971.tar.zst
gsoc2013-evolution-7b379b8f3b59bafc137054a66ffd40a1e5908971.zip
fix nastiness with mime dispositions ( at least for now )
svn path=/trunk/; revision=2195
-rw-r--r--camel/ChangeLog8
-rw-r--r--camel/camel-data-wrapper.c2
-rw-r--r--camel/camel-mime-part.c9
-rw-r--r--camel/gmime-content-field.c5
4 files changed, 17 insertions, 7 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index d70074b805..396fdece55 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,11 @@
+2000-03-27 Michael Meeks <michael@helixcode.com>
+
+ * camel-mime-part.c (my_set_disposition): fix so less broken.
+ (my_finalize): remove dodgy disposition free.
+
+ * camel-data-wrapper.c (my_set_mime_type_field): unref instead of
+ free on mime_type.
+
2000-03-27 Dan Winship <danw@helixcode.com>
* camel-service.c (camel_service_free_auth_types): new routine to
diff --git a/camel/camel-data-wrapper.c b/camel/camel-data-wrapper.c
index 0c330c890f..1cf79a70e4 100644
--- a/camel/camel-data-wrapper.c
+++ b/camel/camel-data-wrapper.c
@@ -363,7 +363,7 @@ camel_data_wrapper_get_mime_type_field (CamelDataWrapper *data_wrapper)
static void
my_set_mime_type_field (CamelDataWrapper *data_wrapper, GMimeContentField *mime_type)
{
- if (data_wrapper->mime_type) gmime_content_field_free (data_wrapper->mime_type);
+ if (data_wrapper->mime_type) gmime_content_field_unref (data_wrapper->mime_type);
data_wrapper->mime_type = mime_type;
}
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 7214738a61..28f313585d 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -243,7 +243,6 @@ my_finalize (GtkObject *object)
CAMEL_LOG_FULL_DEBUG ("Entering CamelMimePart::finalize\n");
g_free (mime_part->description);
- gmime_content_field_unref (mime_part->disposition);
g_free (mime_part->content_id);
g_free (mime_part->content_MD5);
string_list_free (mime_part->content_languages);
@@ -320,11 +319,13 @@ my_set_disposition (CamelMimePart *mime_part, const gchar *disposition)
{
#warning Do not use MimeContentfield here !!!
- if (mime_part->disposition) g_free ((mime_part->disposition)->type);
- g_free (mime_part->disposition);
+ if (mime_part->disposition) {
+ g_free (mime_part->disposition->type);
+ g_free (mime_part->disposition);
+ }
mime_part->disposition = g_new0 (GMimeContentField,1);
- (mime_part->disposition)->type = g_strdup (disposition);
+ mime_part->disposition->type = g_strdup (disposition);
}
diff --git a/camel/gmime-content-field.c b/camel/gmime-content-field.c
index 7f93ae1db2..6788332753 100644
--- a/camel/gmime-content-field.c
+++ b/camel/gmime-content-field.c
@@ -52,7 +52,7 @@ gmime_content_field_new (const gchar *type, const gchar *subtype)
ctf = g_new (GMimeContentField, 1);
ctf->type = g_strdup (type);
ctf->subtype = g_strdup (subtype);
- ctf->parameters = g_hash_table_new (g_strcase_hash, g_strcase_equal);
+ ctf->parameters = g_hash_table_new (g_strcase_hash, g_strcase_equal);
ctf->ref = 1;
return ctf;
@@ -79,6 +79,8 @@ gmime_content_field_free (GMimeContentField *content_field)
{
if (!content_field) return;
+ g_assert (content_field->ref <= 0);
+
g_hash_table_foreach (content_field->parameters, _free_parameter, NULL);
g_free (content_field->type);
g_free (content_field->subtype);
@@ -293,7 +295,6 @@ void
gmime_content_field_construct_from_string (GMimeContentField *content_field, const gchar *string)
{
gint first, len;
- gchar *str;
gint i=0;
gchar *type, *subtype;
gchar *param_name, *param_value;