提交 18df157d authored 作者: Thomas Mueller's avatar Thomas Mueller

When using DB_CLOSE_DELAY, sometimes a NullPointerException is thrown.

上级 de8bb10a
......@@ -34,7 +34,9 @@ public class DatabaseCloser extends Thread {
synchronized (this) {
databaseRef = null;
}
if (getThreadGroup().activeCount() > 100) {
ThreadGroup threadGroup = getThreadGroup();
// the threadGroup could be null if the thread was run in the meantime
if (threadGroup != null && threadGroup.activeCount() > 100) {
// in JDK 1.4 and below, all Thread objects are added to the ThreadGroup,
// and cause a memory leak if never started.
// Need to start it, otherwise it leaks memory in JDK 1.4 and below
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论