nativescript-community / ui-material-components

Monorepo that contains all of the NativeScript Material Design plugins.
https://nativescript-community.github.io/ui-material-components/
Apache License 2.0
219 stars 80 forks source link

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

Open mono-tropa opened 3 months ago

mono-tropa commented 3 months ago

Which platform(s) does your issue occur on?

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

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

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 commented 3 months ago

@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 commented 3 months ago

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.