Fix Android finalize deprecation warning#8
Conversation
Agent-Logs-Url: https://github.com/AlexeyBuryanov/FFImageLoading.Cross/sessions/7ae3d244-25ff-4694-be6d-e8924174cce3 Co-authored-by: AlexeyBuryanov <18596167+AlexeyBuryanov@users.noreply.github.com>
Agent-Logs-Url: https://github.com/AlexeyBuryanov/FFImageLoading.Cross/sessions/7ae3d244-25ff-4694-be6d-e8924174cce3 Co-authored-by: AlexeyBuryanov <18596167+AlexeyBuryanov@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR removes the JavaFinalize() override from the Android SelfDisposingBitmapDrawable to eliminate the deprecated Java finalize() stub that .NET for Android would otherwise generate, while keeping the existing Dispose(bool) cleanup order intact.
Changes:
- Removed the
JavaFinalize()override fromSelfDisposingBitmapDrawable. - Preserved the
Dispose(bool)behavior (callingSetNoLongerDisplayed()afterbase.Dispose(disposing)), keeping cleanup behavior consistent.
|
@copilot are you sure it's won't break anything? |
I’m confident for the library’s intended lifecycle. The removed method was only the Java |
Summary
JavaFinalizeoverride fromSelfDisposingBitmapDrawableDispose(bool)cleanup order so cleanup behavior stays unchangedfinalize()stub for this drawableValidation
dotnet restore source/FFImageLoading.Droid/FFImageLoading.Droid.csprojdotnet build source/FFImageLoading.Droid/FFImageLoading.Droid.csproj -c Debug --no-restoreparallel_validation(Code Review + CodeQL)Notes
SelfDisposingBitmapDrawable.javafinalize()removal warning is no longer emitted in the Android build output.