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(nullRef): nullify reference to the destroyed slider #5377

Merged
merged 1 commit into from
Feb 10, 2016

Conversation

VinceOPS
Copy link

@VinceOPS VinceOPS commented Feb 9, 2016

Hi ionic team.

I've got an issue today with ionSlides, using it in a ui-view. When leaving the view containing the slider, by loading another one into the ui-view, the update method of ionSlides was triggered and executed _this.__slider.update() in spite of the "falsy-check" just before. Indeed, the instance of the slider is kept even after the slider is destroyed (because of $scope $destroy event).

A simple PR to nullify the reference after the slider is destroyed.

In order for this piece of code to work properly:

  this.update = function() {
    $timeout(function() {
      if (!_this.__slider) {
        return;
      }

      // not called if the reference is properly nullified
      _this.__slider.update();
      [...]

adamdbradley added a commit that referenced this pull request Feb 10, 2016
fix(nullRef): nullify reference to the destroyed slider
@adamdbradley adamdbradley merged commit d5ecd3f into ionic-team:master Feb 10, 2016
@adamdbradley
Copy link
Contributor

thanks!

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

Successfully merging this pull request may close these issues.

2 participants