This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[webview_flutter_wkwebview][webview_flutter_android] Fixes bug where the WebView
s could not be released
#6996
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd79ce5
to
76f294c
Compare
WKWebView
could not be released
When will this fix be merged? Need it to get my project working 😁 |
WKWebView
could not be releasedWebView
s could not be released
WebView
s could not be releasedWebView
s could not be released
bparrishMines
commented
Jan 30, 2023
// callback methods remain reachable. | ||
// ignore: unused_field | ||
late AndroidNavigationDelegate _currentNavigationDelegate; | ||
AndroidNavigationDelegate? _currentNavigationDelegate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this nullable fixes flutter/flutter#119332
cyanglaz
approved these changes
Jan 30, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2023
…bug where the `WebView`s could not be released (flutter/plugins#6996)
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jan 31, 2023
* 90f447313 [ci] Increase timeouts for platform_tests (flutter/plugins#7036) * f5568e4b1 [google_sign_in] Add doc for iOS auth with SERVER_CLIENT_ID (flutter/plugins#4747) * 0c05e8d91 Roll Flutter from a815ee6 to 75680ae (58 revisions) (flutter/plugins#7048) * a4c320902 [camera]: Bump camerax_version from 1.3.0-alpha02 to 1.3.0-alpha03 in /packages/camera/camera_android_camerax/android (flutter/plugins#7061) * 8f12b27b6 [ci] Add LUCI versions of macOS ARM tests (flutter/plugins#6984) * 3843b38e2 [tool] Improve main-branch detection (flutter/plugins#7038) * d39e7569c [in_app_purchase] Prep for more const widgets (flutter/plugins#7030) * ddb9777ee [ci] Switch remaining macOS host tests to LUCI (flutter/plugins#7063) * 2edf56324 [ci] Part 1 of swapping iOS platform test arch (flutter/plugins#7064) * 35f0b1a49 [camerax] Add system services to plugin (flutter/plugins#6986) * 5dd0f41a2 [webview]: Bump mockito-inline (flutter/plugins#7056) * 1896f10ca [webview_flutter_wkwebview][webview_flutter_android] Fixes bug where the `WebView`s could not be released (flutter/plugins#6996) * a494825fa [camerax] Allow instance manager to create identical objects (flutter/plugins#7034) * 6ef73da26 [ci] Increase heavy workload memory (flutter/plugins#7065) * 9da327ca3 [various] Update to use sharedDarwinSource (flutter/plugins#7027)
11 tasks
11 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
autosubmit
Merge PR when tree becomes green via auto submit App
p: webview_flutter
Edits files for a webview_flutter plugin
platform-android
platform-ios
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes flutter/flutter#118579
tldr;
Fixed a bug caused by misusing
withWeakRefenceTo
. And fixed integration tests that started to stall because of the change.So, apparently this causes a circular reference:
but this doesn't:
It seems important that the callback method can't include any references to external values. I should have followed my own example 🤦♂️.
It also seems this change affected a bunch of integration tests. My assumption that Android required displaying the WebView to get the
onPageFinished
callback may have been incorrect. The callback doesn't work consistently unless a widget is loaded. This now happens on iOS AND Android. I was unable to debug why this is the case. It could just be quirk of integration tests. The callbacks still work in the example app when running in debug and release mode, so I don't think it is indicative of another bug.Also tack on an additional quick fix for Android:
Fixes flutter/flutter#119332
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.