File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -589,6 +589,7 @@ export default EmberObject.extend({
589
589
this . _super ( ...arguments ) ;
590
590
591
591
this . token = new Token ( ) ;
592
+ this . _root = null ;
592
593
593
594
this . _sortColumnsByFixed = this . sortColumnsByFixed . bind ( this ) ;
594
595
this . _ensureWidthConstraint = this . ensureWidthConstraint . bind ( this ) ;
@@ -599,7 +600,10 @@ export default EmberObject.extend({
599
600
600
601
destroy ( ) {
601
602
this . token . cancel ( ) ;
602
- get ( this , 'root' ) . destroy ( ) ;
603
+
604
+ if ( this . _root ) {
605
+ this . _root . destroy ( ) ;
606
+ }
603
607
604
608
removeObserver ( this , 'columns.@each.isFixed' , this . _sortColumnsByFixed ) ;
605
609
removeObserver ( this , 'widthConstraint' , this . _ensureWidthConstraint ) ;
@@ -608,9 +612,14 @@ export default EmberObject.extend({
608
612
} ,
609
613
610
614
root : computed ( 'columns' , function ( ) {
615
+ if ( this . _root ) {
616
+ this . _root . destroy ( ) ;
617
+ }
618
+
611
619
let columns = get ( this , 'columns' ) ;
612
620
613
- return ColumnTreeNode . create ( { column : { subcolumns : columns } , tree : this } ) ;
621
+ this . _root = ColumnTreeNode . create ( { column : { subcolumns : columns } , tree : this } ) ;
622
+ return this . _root ;
614
623
} ) ,
615
624
616
625
rows : computed ( 'root.{maxChildDepth,leaves.[]}' , function ( ) {
You can’t perform that action at this time.
0 commit comments