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(md-spinner): animation not being cleaned up when used with AoT #1838

Merged
merged 1 commit into from
Nov 15, 2016

Conversation

crisbeto
Copy link
Member

Fixes the md-spinner animation interval not being cleaned up when the app has been compiled through the AoT.
This is due to the the fact that the ngOnDestroy handler is in the base MdProgressCircle class.

Fixes #1283.

Note: At some point it may be better to reorganize the component so we have the following setup:

  • Base progress circle class - handles all of the rendering and animation logic.
  • Progress circle class - a subclass that only handles the determinate mode.
  • Progress spinner - a subclass that only handles the spinning animation.

This should avoid having to refer to the super class for things like cleaning up the animation.

Fixes the `md-spinner` animation interval not being cleaned up when the app has been compiled through the AoT.
This is due to the the fact that the `ngOnDestroy` handler is in the base `MdProgressCircle` class.

Fixes angular#1283.
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 12, 2016
// The `ngOnDestroy` from `MdProgressCircle` should be called explicitly, because
// in certain cases Angular won't call it (e.g. when using AoT and in unit tests).
super.ngOnDestroy();
}
Copy link
Member

Choose a reason for hiding this comment

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

@tbosch Is this the intended behavior for generated code?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to note that this happens in the unit tests as well. I'm pretty sure that they're not using AoT.

Copy link

Choose a reason for hiding this comment

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

Sadly yes, see angular/angular#11606

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Nov 15, 2016
@jelbourn
Copy link
Member

LGTM

@kara kara merged commit 83de14f into angular:master Nov 15, 2016
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 15, 2016
Similarly to angular#1838, the `tab-link` destroy handler may not be called in certain situations, because it is being inherited from the MdRipple class. This PR explicitly calls the destroy handler.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 17, 2016
* Similarly to angular#1838, the `tab-link` destroy handler may not be called in certain situations, because it is being inherited from the MdRipple class. This PR explicitly calls the destroy handler.
* Adds a unit test to make sure that the ripples are being cleaned up properly.
tinayuangao pushed a commit that referenced this pull request Nov 28, 2016
* Similarly to #1838, the `tab-link` destroy handler may not be called in certain situations, because it is being inherited from the MdRipple class. This PR explicitly calls the destroy handler.
* Adds a unit test to make sure that the ripples are being cleaned up properly.
@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 6, 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.

bug(md-spinner): possible memory leak with AoT
5 participants