Skip to content

Commit

Permalink
Remove finalizer in CloseableReference
Browse files Browse the repository at this point in the history
Reviewed By: wizh

Differential Revision: D31483412

fbshipit-source-id: 47a1d9f5019e98462526b6d1708274782ef7a025
  • Loading branch information
defHLT authored and facebook-github-bot committed Oct 11, 2021
1 parent 532459f commit 2e550aa
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,23 +369,4 @@ public static void closeSafely(@Nullable Iterable<? extends CloseableReference<?
}
}
}

@Override
protected void finalize() throws Throwable {
try {
// We put synchronized here so that lint doesn't warn about accessing mIsClosed, which is
// guarded by this. Lint isn't aware of finalize semantics.
synchronized (this) {
if (mIsClosed) {
return;
}
}

mLeakHandler.reportLeak((SharedReference<Object>) mSharedReference, mStacktrace);

close();
} finally {
super.finalize();
}
}
}

0 comments on commit 2e550aa

Please sign in to comment.