Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Angular 1.X Scope Based Child Grid not getting destroyed (Memory Leak) #84

Closed
ananddc1989 opened this issue Nov 3, 2016 · 3 comments
Closed

Comments

@ananddc1989
Copy link

ananddc1989 commented Nov 3, 2016

I have implemented the scope based master details grid to achieve the angularCompileRows: true in the child grid, this.MD will be unique ID

DetailPanelCellRenderer.prototype.destroy = function () {
                console.log($scope["detailGridOptions" + this.MD])
                if ($scope["detailGridOptions" + this.MD].api !== null)
                    $scope["detailGridOptions" + this.MD].api.destroy();
                else
                    delete $scope["detailGridOptions" + this.MD];
            };

So destroy method not happening due to api is null while collapse, But JS based sub grid have api.
This Leading the Memory Leak

Grid Objects still in memory because destroy not happen, Please provide solution !

Thanks

@ananddc1989
Copy link
Author

ananddc1989 commented Nov 3, 2016

@ceolter , @seanlandsman ,

Can you help me out of this issue any one? sub grid is working fine with scope, but unable to destroy the api, because its null in destroy method, i haven't found any sample for angular 1.X edition for master detail grid. this is case is happen not only sub grid,

//#region Destroy
            $scope.$on("$destroy", function () {
                console.log($scope.myGridoptions)
                if ($scope.myGridoptions.api !== null)
                    $scope.myGridoptions.api.destroy();
                $scope.myGridoptions= null;
            });

 //#endregion

Controller destroy method also,

@seanlandsman
Copy link
Member

Hi - if you are using the enterprise version of ag-grid, please post your question on the enterprise forum: https://ag-grid.com/forum

@seanlandsman
Copy link
Member

I see that this is a duplicate of ag-grid/ag-grid#1234 - closing this one, we'll take a look at the other issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants