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 @@ -434,6 +434,7 @@ public void destroy() {
434434 if (!isAttached ()) return ;
435435
436436 getHolder ().removeCallback (mSurfaceCallback );
437+ releaseAccessibilityNodeProvider ();
437438
438439 mNativeView .destroy ();
439440 mNativeView = null ;
@@ -753,9 +754,7 @@ protected void onAttachedToWindow() {
753754 @ Override
754755 protected void onDetachedFromWindow () {
755756 super .onDetachedFromWindow ();
756-
757- mAccessibilityNodeProvider .release ();
758- mAccessibilityNodeProvider = null ;
757+ releaseAccessibilityNodeProvider ();
759758 }
760759
761760 // TODO(mattcarroll): Confer with Ian as to why we need this method. Delete if possible, otherwise
@@ -780,6 +779,13 @@ public AccessibilityNodeProvider getAccessibilityNodeProvider() {
780779 }
781780 }
782781
782+ private void releaseAccessibilityNodeProvider () {
783+ if (mAccessibilityNodeProvider != null ) {
784+ mAccessibilityNodeProvider .release ();
785+ mAccessibilityNodeProvider = null ;
786+ }
787+ }
788+
783789 @ Override
784790 @ TargetApi (Build .VERSION_CODES .N )
785791 @ RequiresApi (Build .VERSION_CODES .N )
You can’t perform that action at this time.
0 commit comments