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