Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit fa5eea3

Browse files
[webview_flutter_android] Updates the Dart InstanceManager to take a listener for when an object is garbage collected (#6148)
1 parent 0d6d03a commit fa5eea3

12 files changed

+480
-235
lines changed

packages/webview_flutter/webview_flutter_android/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.9.3
2+
3+
* Updates the Dart InstanceManager to take a listener for when an object is garbage collected.
4+
See https://github.com/flutter/flutter/issues/107199.
5+
16
## 2.9.2
27

38
* Updates the Java InstanceManager to take a listener for when an object is garbage collected.

packages/webview_flutter/webview_flutter_android/lib/src/android_webview.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ abstract class JavaObject with Copyable {
2828
/// This should only be used by subclasses created by this library or to
2929
/// create copies.
3030
JavaObject.detached();
31+
32+
/// Global instance of [InstanceManager].
33+
static final InstanceManager globalInstanceManager = InstanceManager(
34+
onWeakReferenceRemoved: (_) {},
35+
);
3136
}
3237

3338
/// An Android View that displays web pages.

0 commit comments

Comments
 (0)