Spasojevic, Daniel wrote:
Batik has continued to be excellent to work with. Thanks to Thomas for
helping out with the last issue that I raised.
Glad to hear it.

I am using Batik in an applet and I am seeing some strange behaviour when
the applet is stopping. I am using a version of CVS that I got today and
Java 1.4.2. I have also seen this behaviour with Batik 1.5 and Java 1.4.1.

When the Threads in the applet's ThreadGroup are being stopped, the
CleanerThread catches a ThreadDeath Error. Since this stops the propagation
of the ThreadDeath Error, the CleanerThread is never stopped.

Hmm, I think it is correct that ThreadDeath not be caught the question is if the thread should catch some of the other throwables - like out of memory. Thanks for bringing this up.

Since I haven't seen any discussion about this on the mailing list before, I
am guessing that some peculiarity of my code is stopping the CleanerThread
from being stopped when it should, necessitating the ThreadDeath when the
applet is stopping.

This may be specific to applets most people are using Batik in applications where I think the JVM just shuts down.

Anyway, as a workaround in my code I changed the run method in
CleanerThread.java from:

public void run() {
while(true) {
try {
... } catch (Throwable t) {
t.printStackTrace();
}
}
}


into:

public void run() {
while(true) {
try {
... } catch (Exception e) {
e.printStackTrace();
}
}
}


This allows the ThreadDeath Error to propagate and the CleanerThread to be
forcibly shut down.

If anyone has seen a similar problem and managed to work out what it was in
their code that was causing the CleanerThread to hang around until the
applet was closed I would really appreciate hearing about it - I am not so
keen on changing the Batik code.

-Daniel Spasojevic


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






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



Reply via email to