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

fix(tooltip): remove native event listener on component destroy #5144

Merged
merged 3 commits into from
Jul 7, 2017
Merged

fix(tooltip): remove native event listener on component destroy #5144

merged 3 commits into from
Jul 7, 2017

Conversation

michastreppel
Copy link
Contributor

Component should clean up events it has registered to.

Closes #4499

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 15, 2017
@michastreppel
Copy link
Contributor Author

cc @andrewseguin

@Eddman
Copy link
Contributor

Eddman commented Jun 19, 2017

Please merge ASAP: it is causing huge mem-leaks in my application so it makes the Chrome tab to crash in few minutes...

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Just one minor comment

() => this.show());
this._leaveListener = _renderer.listen(_elementRef.nativeElement,
'mouseleave',
() => this.hide());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer breaking at the higher syntactic level:

    this._enterListener = 
        _renderer.listen(_elementRef.nativeElement, 'mouseenter', () => this.show());
    this._leaveListener = 
        _renderer.listen(_elementRef.nativeElement, 'mouseleave', () => this.hide());

@michastreppel
Copy link
Contributor Author

@jelbourn I've resolved the comment and rebased the commit

@jelbourn
Copy link
Member

@michastreppel please revert all of the formatting changes to the file

@michastreppel
Copy link
Contributor Author

@jelbourn Done

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jun 23, 2017
@michastreppel
Copy link
Contributor Author

@jelbourn @tinayuangao I've rebased this PR.

@DBosley
Copy link

DBosley commented Jul 5, 2017

@jelbourn Please merge this pr asap. The tooltips are causing major issues in my app.

@mmalerba mmalerba merged commit 32db2ba into angular:master Jul 7, 2017
@michastreppel michastreppel deleted the RemoveListenersOnDestroy branch July 8, 2017 11:46
amcdnl pushed a commit to amcdnl/material2 that referenced this pull request Jul 8, 2017
…lar#5144)

* fix(tooltip): remove native event listener on component destroy

Component should clean up events it has registered to.

Closes angular#4499

* Break at higher syntactic level

* Undo accidental formatting
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tooltip Memory Leak
7 participants