kendo-angular
kendo-angular copied to clipboard
Memory leak in TreeList
Describe the bug When the TreeList component is rerendered multiple times, a memory leak is observed. Here is a stats comparison between the Grid and TreeList:
Grid:

TreeList:

To Reproduce treelist-A14.zip
- Download and unzip the folder.
- Run npm install.
- Execute ng serve.
Consider fixing this issue in the previous major v2.x.x of the component.
A client observed that the memory leak is probably caused by the subscription in the BrowserSupportService class.
The implements ngOnDestroy where the subscription is unsubscribed:
@Injectable()
export class BrowserSupportService implements OnDestroy {
constructor(private zone: NgZone, private changeDetector: ChangeDetectorRef) {
...
this.zone.runOutsideAngular(() => {
this.subscriptions = fromEvent(window, 'resize').pipe(
auditTime(100)
).subscribe(() => {
if (cachedPixelRatio !== window.devicePixelRatio) {
...
}
});
});
}
public ngOnDestroy(): void {
if (this.subscriptions) {
this.subscriptions.unsubscribe();
this.subscriptions = null;
}
}
But the TreeList doesn't implement OnDestroy hook at all, hence the subscription is not unsubscribed.
Private support thread: 1613018
Fixed in v13.1.0.