This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
shell/platform/android/io/flutter/view Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -432,6 +432,7 @@ public void destroy() {
432432 if (!isAttached ()) return ;
433433
434434 getHolder ().removeCallback (mSurfaceCallback );
435+ releaseAccessibilityNodeProvider ();
435436
436437 mNativeView .destroy ();
437438 mNativeView = null ;
@@ -749,9 +750,7 @@ protected void onAttachedToWindow() {
749750 @ Override
750751 protected void onDetachedFromWindow () {
751752 super .onDetachedFromWindow ();
752-
753- mAccessibilityNodeProvider .release ();
754- mAccessibilityNodeProvider = null ;
753+ releaseAccessibilityNodeProvider ();
755754 }
756755
757756 // TODO(mattcarroll): Confer with Ian as to why we need this method. Delete if possible, otherwise
@@ -776,6 +775,13 @@ public AccessibilityNodeProvider getAccessibilityNodeProvider() {
776775 }
777776 }
778777
778+ private void releaseAccessibilityNodeProvider () {
779+ if (mAccessibilityNodeProvider != null ) {
780+ mAccessibilityNodeProvider .release ();
781+ mAccessibilityNodeProvider = null ;
782+ }
783+ }
784+
779785 @ Override
780786 @ TargetApi (Build .VERSION_CODES .N )
781787 @ RequiresApi (Build .VERSION_CODES .N )
You can’t perform that action at this time.
0 commit comments