sync destructor list add
@@ -352,12 +352,14 @@ public abstract class CloseableReference<T> implements Cloneable, Closeable {
super(referent, referenceQueue);
mSharedReference = referent.mSharedReference;
+ synchronized (Destructor.class) {
if (sHead != null) {
sHead.next = this;
previous = sHead;
}
sHead = this;
}
+ }
public synchronized boolean isDestroyed() {
return destroyed;
