Skip to content

fix: ChannelController.debugAssertNotDisposed() throwing when calli… #2558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MSOB7YY
Copy link

@MSOB7YY MSOB7YY commented Mar 12, 2025

when disposing PlatformInAppWebViewController, it calls InternalChannelController.disposeChannel() which tries to set the channel handler to null, but the issue is that it access the channel through the getter channel which has a debug assert that it shouldn't be disposed (channel == null)

this might or might not cause the resources to not be freed while debugging

in this pr, we access the _channel variable directly, if it's null then setMethodCallHandler will simply not execute

Connection with issue(s)

Resolve issue #2104

Connected to N/A

Testing and Review Notes

to test

  flutter_inappwebview:
    git:
      url: https://github.com/MSOB7YY/flutter_inappwebview
      path: flutter_inappwebview

Screenshots or Videos

image
image

To Do

  • double check the original issue to confirm it is fully satisfied
  • add testing notes and screenshots in PR description to help guide reviewers
  • request the "UX" team perform a design review (if/when applicable)

@probot-autolabeler probot-autolabeler bot added android iOS linux Linux platform macOS macOS platform platform_interface Platform Interface plugin flutter_inappwebview plugin web windows Windows platform labels Mar 12, 2025
@sabikrahat
Copy link

Thank you. This solution works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android iOS linux Linux platform macOS macOS platform platform_interface Platform Interface plugin flutter_inappwebview plugin web windows Windows platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants