Call PhantomReference.clear() from close()
This commit is contained in:
parent
09b022e926
commit
ea6113d7fb
@ -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 --;
|
||||||
|
Loading…
Reference in New Issue
Block a user