alibaba / alibaba/flutter_boost
iOS混合开发FBFlutterViewContainer出现内存泄漏的问题
- Dominant language
- Dart
- Stars
- 7.2k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
原生页面A跳转到Flutter页面B,再返回A,FBFlutterViewContainer中dealloc不执行,而且我进入页面B时,dealloc会先执行,viewDidLoad后执行

这个是刚进入Flutter页面B的log

返回原生页面A时dealloc没有执行
flutter版本:2.5.0
flutter_boost版本:v3.0-null-safety-preview.18
flutter doctor -v的log信息:
[✓] Flutter (Channel stable, 2.5.0, on macOS 12.0.1 21A559 darwin-arm, locale
zh-Hans-CN)
• Flutter version 2.5.0 at /Users/taobo/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cc385b4b8 (5 months ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/taobo/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio
2.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 13.0, Build version 13A233
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio 2.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[✓] VS Code (version 1.63.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (4 available)
• iPhone (2) (mobile) • aa7753fb9a1e0feb019cc267741092defcef4b9e • ios
• iOS 13.5.1 17F80
• iPhone 13 (mobile) • D970BC6B-5753-413A-BC73-7DBF97F2D813 • ios
• com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• macOS (desktop) • macos •
darwin-arm64 • macOS 12.0.1 21A559 darwin-arm
• Chrome (web) • chrome •
web-javascript • Google Chrome 98.0.4758.102
• No issues found!
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the native page A → Flutter page B → A navigation flow using Flutter 2.5.0 and flutter_boost v3.0-null-safety-preview.18, then inspect FBFlutterViewContainer lifecycle logs around viewDidLoad and dealloc. Done means the container lifecycle matches the expected navigation behavior and the reported memory leak is no longer observed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, ios
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100