Skip to content

Commit

Permalink
fix(ViewController): avoid deep copy in dismiss() that can turn into …
Browse files Browse the repository at this point in the history
…an infinite loop

For some reason, apparently related to the NavOptions.ev field,
this deep copy was turning into an infinite loop on a Nexus 7 / android 5.1.1 webview.
Replace with a non-deep copy since the deep copy is unnecessary in this case.
  • Loading branch information
vanackere committed Oct 3, 2016
1 parent 3a75eb4 commit 9227310
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/navigation/view-controller.ts
@@ -1,7 +1,7 @@
import { ComponentRef, ElementRef, EventEmitter, Output, Renderer } from '@angular/core';

import { Footer, Header } from '../components/toolbar/toolbar';
import { isPresent, merge } from '../util/util';
import { isPresent, assign } from '../util/util';
import { Navbar } from '../components/navbar/navbar';
import { NavControllerBase } from './nav-controller-base';
import { NavOptions, ViewState } from './nav-util';
Expand Down Expand Up @@ -184,7 +184,7 @@ export class ViewController {
return Promise.resolve(false);
}

let options = merge({}, this._leavingOpts, navOptions);
let options = assign({}, this._leavingOpts, navOptions);
this._onWillDismiss && this._onWillDismiss(data, role);
return this._nav.remove(this._nav.indexOf(this), 1, options).then(() => {
this._onDidDismiss && this._onDidDismiss(data, role);
Expand Down

0 comments on commit 9227310

Please sign in to comment.