https://issues.apache.org/bugzilla/show_bug.cgi?id=46360

--- Comment #7 from Alexis Giotis <alex.gio...@gmail.com> 2010-09-02 07:52:22 
EDT ---
Created an attachment (id=25970)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25970)
Patch to clone the SVG document inside PDFImageHandlerSVG

The patch is attached after a short discussion in the fop-dev mailing list.
Shortly, in PDFImageHandlerSVG.handleImage() the SVG document is not cloned but
in other places it is. Examples of cloning are in ImageConverterSVG2G2D,
AbstractGenericSVGHandler, AFPImageHandlerSVG, AFPSVGHandler, Java2DSVGHandler,
PSSVGHandler.

Before the patch, in a multi-threaded environment parsing of the SVG documents
was corrupted with a probability close to 80%. After this, the errors can not
be reproduced. This patch contains the smallest change I could do, is for a
single file and should be safe to apply.

On a side note, normally I would first try to gather the building of the
GraphicsNode in a single place and then avoid the document cloning by
serializing only the parsing of the SVG. But that would affect more files /
projects and would make the processing of the patch more difficult.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to