Skip to content
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

Instance a FlutterViewController with initWithEngine and push from native page, after pop it the memory not released. How to release the engine? #25255

Closed
Arnold134777 opened this issue Dec 12, 2018 · 5 comments
Labels
a: existing-apps Integration with existing apps via the add-to-app flow c: performance Relates to speed or footprint issues (see "perf:" labels) engine flutter/engine repository. See also e: labels. waiting for PR to land (fixed) A fix is in flight

Comments

@Arnold134777
Copy link

Arnold134777 commented Dec 12, 2018

Instance a FlutterViewController with initWithEngine and push from native page,
after pop it the memory not released. How to release the engine?

- (void)handleShowAction {
    if(_engine == nil) {
        _engine = [[FlutterEngine alloc] initWithName:@"io.flutter" project:nil];
        [_engine runWithEntrypoint:nil];
    }
    
    FlutterViewController *feedVC = [[FlutterViewController alloc] initWithEngine:_engine nibName:nil bundle:nil];
    [(UINavigationController *)self.window.rootViewController pushViewController:feedVC animated:YES];
}

- (void)handleDismissAction {
    [(UINavigationController *)self.window.rootViewController popViewControllerAnimated:YES];
    _engine = nil;
}
[✓] Flutter (Channel faceu_dev_1.0.0, v1.0.1-pre.5, on Mac OS X 10.13.6 17G65,
    locale zh-Hans-CN)
    • Flutter version 1.0.1-pre.5 at
      /Users/arnold/Documents/study/flutter/flutter
    • Framework revision 0fd43583b8 (3 days ago), 2018-12-09 19:12:32 +0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from:
      https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK
      components.
      (or visit https://flutter.io/setup/#android-setup for detailed
      instructions).
      If Android SDK has been installed to a custom location, set $ANDROID_HOME
      to that location.
      You may also want to add it to your PATH environment variable.


[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 2.0.0
    • CocoaPods version 1.5.3

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).

[!] VS Code (version 1.29.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
@Arnold134777 Arnold134777 changed the title Instance a FlutterViewController with initWithEngine an push from native page, when pop the memory not released. How to release the engine? Instance a FlutterViewController with initWithEngine and push from native page, when pop the memory not released. How to release the engine? Dec 12, 2018
@Arnold134777 Arnold134777 changed the title Instance a FlutterViewController with initWithEngine and push from native page, when pop the memory not released. How to release the engine? Instance a FlutterViewController with initWithEngine and push from native page, after pop it the memory not released. How to release the engine? Dec 12, 2018
@zoechi zoechi added c: performance Relates to speed or footprint issues (see "perf:" labels) a: existing-apps Integration with existing apps via the add-to-app flow engine flutter/engine repository. See also e: labels. labels Dec 12, 2018
@zoechi zoechi added this to the Goals milestone Dec 12, 2018
@zoechi
Copy link
Contributor

zoechi commented Dec 12, 2018

Looks related to or duplicate of #16995

@dnfield
Copy link
Contributor

dnfield commented Dec 14, 2018

Will be fixed by flutter/engine#6879

@zoechi
Copy link
Contributor

zoechi commented Feb 22, 2019

I assume this can be closed.

@zoechi zoechi closed this as completed Feb 22, 2019
@cuong1112035
Copy link

I'm having this issue, using Flutter v1.5.4-hotfix.2

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: existing-apps Integration with existing apps via the add-to-app flow c: performance Relates to speed or footprint issues (see "perf:" labels) engine flutter/engine repository. See also e: labels. waiting for PR to land (fixed) A fix is in flight
Projects
None yet
Development

No branches or pull requests

4 participants