just a simple catch all for OOM while handling an OOM (naw, we dont recurse too much (just a little))

This commit is contained in:
jrandom
2004-06-19 23:25:47 +00:00
committed by zzz
parent 3835fe3960
commit f4697be159

View File

@ -43,11 +43,16 @@ public class I2PThread extends Thread {
try { try {
super.run(); super.run();
} catch (Throwable t) { } catch (Throwable t) {
try {
// we cant assume log is created
if (_log == null) _log = new Log(I2PThread.class);
_log.log(Log.CRIT, "Killing thread " + getName(), t);
} catch (Throwable woof) {
System.err.println("Died within the OOM itself");
t.printStackTrace();
}
if (t instanceof OutOfMemoryError) if (t instanceof OutOfMemoryError)
fireOOM((OutOfMemoryError)t); fireOOM((OutOfMemoryError)t);
// we cant assume log is created
if (_log == null) _log = new Log(I2PThread.class);
_log.log(Log.CRIT, "Killing thread " + getName(), t);
} }
} }