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

Modal/Dialog memory leak #1847

Closed
1 of 2 tasks
beig opened this issue Jul 19, 2019 · 2 comments · Fixed by #1860
Closed
1 of 2 tasks

Modal/Dialog memory leak #1847

beig opened this issue Jul 19, 2019 · 2 comments · Fixed by #1860

Comments

@beig
Copy link

beig commented Jul 19, 2019

Issue type

I'm submitting a ... (check one with "x")

  • bug report
  • feature request

Issue description

Current behavior:
Modal Components stay in memory

Expected behavior:
They should get destroyed

Steps to reproduce:
create new angular project

ng new test
ng add @nebular/theme
# add NbDialogModule.forRoot() in app.module
# create another component and open it with the NbDialogservice
this.dialogService.open(TestComponent);

take a memory snapshot with dev tools

image

Related code:

insert short code snippets here

Other information:

npm, node, OS, Browser

<!--
Node, npm: `node --version` and `npm --version`
OS: Windows 10
Browser: Chrome
-->

Angular, Nebular

    "@angular/common": "~8.1.0",
    "@nebular/theme": "^4.1.2",
@yggg
Copy link
Contributor

yggg commented Jul 22, 2019

Thanks for reporting @beig, I can confirm the issue.

Related code:

protected registerCloseListeners<T>(config: NbDialogConfig, overlayRef: NbOverlayRef, dialogRef: NbDialogRef<T>) {

Adding takeUntil(dialogRef.onClose) should be enough. Also, we need to check window component for the same problem.

@beig
Copy link
Author

beig commented Jul 22, 2019 via email

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

Successfully merging a pull request may close this issue.

2 participants