telerik / kendo-angular

Issue tracker - Kendo UI for Angular
http://www.telerik.com/kendo-angular-ui/
Other
464 stars 213 forks source link

Memory leak when using kendoUploadDropZone or kendoFileSelectDropZone directives #4295

Closed RyanFM closed 1 month ago

RyanFM commented 2 months ago

Describe the bug Using the UploadDropZoneDirective in the Kendo FileSelect or Upload components causes a memory leak, as seen when repeatedly initializing and destroying the component such as in an ngIf.

Example with the directive, after showing and hiding the component 10 times

Screenshot 2024-05-08 134406 Screenshot 2024-05-08 134335

Example without the directive

Screenshot 2024-05-08 141341 Screenshot 2024-05-08 134142

To Reproduce Using this example: https://stackblitz.com/edit/angular-kg16zc-5gczvx?file=src%2Fapp%2Fapp.component.ts

  1. Click the "Click here" text repeatedly to show and hide the file select component.
  2. Open DevTools (Chrome or Edge) and go to the memory tab.
  3. Select the JavaScript VM instance that looks like the highlighted one here:
Screenshot 2024-05-08 134036
  1. Take a heap snapshot.
  2. In summary view, filter for "dropzone" or "component" to see that FileSelectComponents, UploadDropZoneDirectives and others are present multiple times, for each time you show and hide it.
yanmariomenev commented 1 month ago

Duplicate of - https://github.com/telerik/kendo-angular/issues/4213