OK, I'm trying to "clean" up after I'm done with an SVG document on the
JSVGCanvas:

jsvgCanvas.stopProcessing();

// Done to avoid errors.
Thread.sleep(200);

jsvgCanvas.setDocument(null);
jsvgCanvas.flushImageCache();

At this point, any embedded image files that were being shown on the
JSVGCanvas will not delete.  The SVG document itself will delete, but
not the images!  How do I get rid of the lock on the image files?

On a related note, when I'm ready to show a new document:

jsvgCanvas.resumeProcessing();
jsvgCanvas.setDocument(...);

...sometimes results in this stack trace:

java.lang.NullPointerException
        at
org.apache.batik.swing.svg.AbstractJSVGComponent.setGraphicsNode(Abstrac
tJSVGComponent.java:824)
        at
org.apache.batik.swing.svg.AbstractJSVGComponent$SVGListener.gvtBuildCom
pleted(AbstractJSVGComponent.java:1479)
        at
org.apache.batik.swing.svg.GVTTreeBuilder$2.dispatch(GVTTreeBuilder.java
:162)
        at
org.apache.batik.util.EventDispatcher.dispatchEvent(EventDispatcher.java
:102)
        at
org.apache.batik.util.EventDispatcher.fireEvent(EventDispatcher.java:86)
        at
org.apache.batik.util.EventDispatcher$1.run(EventDispatcher.java:45)
        at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThrea
d.java:242)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.
java:163)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at
java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Any way around that?

This is still the 1/08/2007 SVN build of Batik.

Michael Bishop

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to