Srini,

Your attachment patch has busted the threading in the mail display.  The
UI can now lock for extended periods because it is doing camel
operations from the main thread.

This particular bit of code is at least one place where it is - and to
be honest, i'm completely baffled by it.  You're copying a whole part
into memory just to copy the part.  Thats what references are for.

Of course, I never got a chance to review this code since you just
committed it anyway, which was completely inappropriate to start with.

Fix it.


EAttachment *
e_attachment_new_from_mime_part (CamelMimePart *part)
{
        EAttachment *new;
        CamelMimePart *mime_part;
        CamelStream *stream;
        
        g_return_val_if_fail (CAMEL_IS_MIME_PART (part), NULL);
        
        stream = camel_stream_mem_new ();
        if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (part),
stream) == -1) {
                camel_object_unref (stream);
                return NULL;
        }
        
        camel_stream_reset (stream);
        mime_part = camel_mime_part_new ();
        
        if (camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER
(mime_part), stream) == -1) {
                camel_object_unref (mime_part);
                camel_object_unref (stream);
                return NULL;
        }
        
        camel_object_unref (stream);

_______________________________________________
evolution-hackers maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/evolution-hackers

Reply via email to