Re: [evolution-patches] (Mailer) Fix for bug 312410



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.

> +       }
>  
>         ((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.

>         em_format_html_add_pobject((EMFormatHTML *)emf, 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]