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

Popover directive with delay can cause a memory leak #6709

Open
EvyatarBHA opened this issue Nov 17, 2024 · 0 comments
Open

Popover directive with delay can cause a memory leak #6709

EvyatarBHA opened this issue Nov 17, 2024 · 0 comments

Comments

@EvyatarBHA
Copy link

In Tooltip directive there's _delaySubscription member, which is unsubscribed in ngOnDestroy method.
However, in Popover directive there's const _timer which isn't being handled in ngOnDestroy method.
This can cause issues in case directive is being destroyed while subscription is active.
In our case, it happened when we used the Popover directive to show additional row details in an ag-grid cell renderer after hovering for 500ms, but it was destroyed when the grid was scrolled.

In addition, both directives contains an old and unused member _delayTimeoutId, which better be deleted regardless.

Versions of ngx-bootstrap, Angular, and Bootstrap:
ngx-bootstrap: 12.0.0 (but exists in latest code too)
Angular: 17.3.0
Bootstrap: 5.3.3

Expected behavior
Delay timer subscription should be unsubscribed if needed in ngOnDestroy method of Popover directive

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

1 participant