flutter_native_admob
flutter_native_admob copied to clipboard
Memory leak. NativeAdmob widget is not disposed.
How to reproduce:
- Start application containing NativeAdmob widget (even with no external or with controller used).
- Open Dart DevTools.
- Navigate back and forward to/from application screens containing/not containing NativeAdmob widget.
- Observe "Memory" page in DevTools. Take memory snapshot.
- Memory snapshot shows several not disposed NativeAdmob widget instances (as well as NativeAdmobController's). Make sure you do not filter any classes in snapshot.
AndroidView widget is not disposed also.
Did you fix this ? Is there any fix for this yet ?
The native view has known issue with memory leak
For anyone struggling with this topic. The memory leak has been fixed in https://github.com/flutter/flutter/pull/50111
At the time of writing the pull request is available in the following tags:
$ git tag --contains 26fabcd41bfa5beaedf718da9d59a0e84cf1cc0d
1.19.0-2.0.pre
1.19.0-3.0.pre
1.19.0-4.0.pre
1.19.0-4.1.pre
1.19.0-4.2.pre
1.19.0-4.3.pre
1.19.0-5.0.pre
1.20.0-0.0.pre
1.20.0-1.0.pre
1.20.0-2.0.pre
1.20.0-3.0.pre
1.20.0-7.0.pre
1.20.0-7.1.pre
If you dare, you can switch to the beta channel:
$ flutter channel beta
Switching to flutter channel 'beta'...
# some outputs omitted....
Successfully switched to flutter channel 'beta'.
To ensure that you're on the latest build from this channel, run 'flutter upgrade'
$ flutter upgrade
# even more outputs omitted...
$ flutter --version
Flutter 1.19.0-4.3.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 8fe7655ed2 (2 weeks ago) • 2020-07-01 14:31:18 -0700
Engine • revision 9a28c3bcf4
Tools • Dart 2.9.0 (build 2.9.0-14.1.beta)
But please beware that this is a beta release...