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

Memory leak when closing bottom sheet via BottomSheetParams.closeCallBack() #467

Open
mono-tropa opened this issue Aug 21, 2024 · 2 comments

Comments

@mono-tropa
Copy link

mono-tropa commented Aug 21, 2024

Which platform(s) does your issue occur on?

  • iOS

Please, provide the following version numbers that your issue occurs with:

  • CLI: 8.8.0
  • Cross-platform modules: 8.7.3
  • Runtime(s): iOS - 8.7.2
  • Plugin(s): 7.2.55
  • Nativescript Angular: 17.1.0

Please, tell us how to recreate the issue in as much detail as possible.

  • Use the bottom-sheet to display a component.
  • Perform some action within the component and call BottomSheetParams.closeCallBack() to close the modal.
  • Do this several times.
  • Invoke Application.getRootView()._getRootModalViews();
  • Notice that the modals opened via the bottom sheet remain in memory and are not cleaned up. If you instead dismiss the bottom sheet by tapping elsewhere in the app (and not closing it via bottomSheetParams.closeCallback()) the modal reference is cleaned up.

Not sure if this is the proper solution, but if you invoke this - this._bottomSheetClosed(); - at the end of ViewWithBottomSheetBase.closeBottomSheet, the modal reference appears to get cleaned up when following the flow listed above.

@farfromrefug
Copy link
Member

@mono-tropa i tested and could not reproduce the issue. Here the modal stack is correctly emptied.
Can you create a simple reproducible example project?

@mono-tropa
Copy link
Author

mono-tropa commented Aug 22, 2024

Here's a link to a sample app.

https://stackblitz.com/edit/nativescript-stackblitz-templates-xwop8k

It appears this issue is only reproducible in iOS, not Android. Sorry about that, i'll amend my original post.

When you open up the bottom sheet and tap done, notice how the items printed in the console log grow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants