Call PhantomReference.clear() from close()

This commit is contained in:
Trustin Lee 2013-02-09 12:20:10 +09:00
parent 09b022e926
commit ea6113d7fb

View File

@ -131,8 +131,6 @@ public final class ResourceLeakDetector<T> {
break; break;
} }
ref.clear();
if (!ref.close()) { if (!ref.close()) {
continue; continue;
} }
@ -174,6 +172,7 @@ public final class ResourceLeakDetector<T> {
@Override @Override
public boolean close() { public boolean close() {
clear();
if (freed.compareAndSet(false, true)) { if (freed.compareAndSet(false, true)) {
synchronized (head) { synchronized (head) {
active --; active --;