Re: [evolution-patches] (Mailer) Fix for bug 312410
- From: Srinivasa Ragavan <sragavan novell com>
- To: Not Zed <notzed ximian com>
- Cc: Evolution Patches <evolution-patches ximian com>
- Subject: Re: [evolution-patches] (Mailer) Fix for bug 312410
- Date: Thu, 04 Aug 2005 14:40:14 +0530
On Thu, 2005-08-04 at 15:56 +0800, Not Zed wrote:
> On Thu, 2005-08-04 at 11:35 +0530, Srinivasa Ragavan wrote:
> >
> > if (efhd->priv->search_dialog)
> > efhd_update_matches(efhd);
> > +
> > + efhd->priv->bar_added = FALSE;
> > + if (efhd->priv->files) {
> > + g_hash_table_destroy (efhd->priv->files);
> > + efhd->priv->files = NULL;
> > + }
> > }
> >
> > /*
> > **********************************************************************
> > */
> > @@ -1047,9 +1053,10 @@ static void efhd_format_clone(EMFormat *
> >
> > efhd->priv->attachment_bar = NULL;
> > efhd->priv->bar_added = FALSE;
> > - if (efhd->priv->files)
> > + if (efhd->priv->files) {
> > g_hash_table_destroy(efhd->priv->files);
> > - efhd->priv->files = g_hash_table_new_full (g_str_hash,
> > g_str_equal, g_free, NULL);
> > + efhd->priv->files = NULL;
>
> This doesn't look right: apart from the formatting being wrong, you're
> still doing it in the clone function - which is not serialised. it can
> be called while another thread is using these pointers.
>
Thanks. done.
> > + }
> >
> > ((EMFormatClass *)efhd_parent)->format_clone(emf, folder, uid,
> > msg, src);
> > }
> > @@ -1958,6 +1984,8 @@ efhd_message_add_bar(EMFormat *emf, Came
> > return;
> >
> > efhd->priv->bar_added = TRUE;
> > + efhd->priv->files = g_hash_table_new_full (g_str_hash,
> > g_str_equal, g_free, NULL);
> > +
>
> Just create the files array here if it isn't created. remove bar_added
> altogether since it is implied by files, and add a destroy of files in
> the object's finalise function.
>
done. I already destroy files in finalise.
> > em_format_html_add_pobject((EMFormatHTML *)emf,
>
> _______________________________________________
> evolution-patches mailing list
> evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
Index: em-format-html-display.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-format-html-display.c,v
retrieving revision 1.70
diff -u -p -r1.70 em-format-html-display.c
--- em-format-html-display.c 25 Jul 2005 04:23:40 -0000 1.70
+++ em-format-html-display.c 4 Aug 2005 08:56:12 -0000
@@ -114,7 +114,6 @@ struct _EMFormatHTMLDisplayPrivate {
GtkWidget *down;
GtkWidget *save;
gboolean show_bar;
- gboolean bar_added;
GHashTable *files;
};
@@ -277,8 +276,7 @@ efhd_init(GObject *o)
#undef efh
efhd->priv->show_bar = FALSE;
- efhd->priv->bar_added = FALSE;
- efhd->priv->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+ efhd->priv->files = NULL;
}
static void
@@ -679,6 +677,11 @@ efhd_complete(EMFormat *emf)
if (efhd->priv->search_dialog)
efhd_update_matches(efhd);
+
+ if (efhd->priv->files) {
+ g_hash_table_destroy (efhd->priv->files);
+ efhd->priv->files = NULL;
+ }
}
/* ********************************************************************** */
@@ -1045,12 +1048,6 @@ static void efhd_format_clone(EMFormat *
efhd->priv->show_bar = FALSE;
}
- efhd->priv->attachment_bar = NULL;
- efhd->priv->bar_added = FALSE;
- if (efhd->priv->files)
- g_hash_table_destroy(efhd->priv->files);
- efhd->priv->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
-
((EMFormatClass *)efhd_parent)->format_clone(emf, folder, uid, msg, src);
}
@@ -1954,10 +1970,11 @@ efhd_message_add_bar(EMFormat *emf, Came
EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *) emf;
const char *classid = "attachment-bar";
- if (efhd->priv->bar_added)
+ if (efhd->priv->files)
return;
- efhd->priv->bar_added = TRUE;
+ efhd->priv->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+
em_format_html_add_pobject((EMFormatHTML *)emf, sizeof(EMFormatHTMLPObject), classid, part, efhd_add_bar);
camel_stream_printf(stream, "<td><object classid=\"%s\"></object></td>", classid);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]