You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> on 2006/10/18 19:19:46 UTC
Removing a document from the JSVGCanvas?
What is the best way to do this?
setDocument(null) resulted in an error:
Exception in thread "Thread-29" java.lang.NullPointerException
at org.apache.batik.swing.svg.AbstractJSVGComponent.stopThenRun(Unknown Source)
at org.apache.batik.swing.svg.AbstractJSVGComponent.setSVGDocument(Unknown Source)
at org.apache.batik.swing.svg.AbstractJSVGComponent.setDocument(Unknown Source)
at mil.jfcom.cie.whiteboard.ui.WBCanvas.destroy(WBCanvas.java:96)
at mil.jfcom.cie.whiteboard.ui.WBContentPane.destroy(WBContentPane.java:218)
at mil.jfcom.cie.whiteboard.ui.WBMainFrame.removeChildren(WBMainFrame.java:56)
Michael Bishop
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Removing a document from the JSVGCanvas?
Posted by th...@kodak.com.
Hi Michael,
"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on
10/18/2006 01:19:46 PM:
> What is the best way to do this?
> setDocument(null) resulted in an error:
Hmm, this is the best way but unfortunately it looks like
there is a race condition. I have seen this sort of error
before the solution is to ensure that all of the event callbacks
bounce back to the AWT thread (in JSVGCanvas.SVGListener) but
I haven't had the time to make a highly reproducable test
case (it seems to occur most on a multi-core Windows box),
which would give my confidence that the bug was actually
fixed after I was done...
You may be better off calling 'stopProcessing' wait a
hundred millisecs or so and then setDocument(null) until
this is sorted out...
> Exception in thread "Thread-29" java.lang.NullPointerException
> at org.apache.batik.swing.svg.AbstractJSVGComponent.stopThenRun(Unknown
Source)
> at
org.apache.batik.swing.svg.AbstractJSVGComponent.setSVGDocument(Unknown
Source)
> at org.apache.batik.swing.svg.AbstractJSVGComponent.setDocument(Unknown
Source)
> at mil.jfcom.cie.whiteboard.ui.WBCanvas.destroy(WBCanvas.java:96)
> at
mil.jfcom.cie.whiteboard.ui.WBContentPane.destroy(WBContentPane.java:218)
> at
mil.jfcom.cie.whiteboard.ui.WBMainFrame.removeChildren(WBMainFrame.java:56)
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org