tinymce-angular icon indicating copy to clipboard operation
tinymce-angular copied to clipboard

Editor Component Memory leak

Open NicolasFernandez212 opened this issue 2 years ago • 3 comments

What is the current behavior? The Editor component is still kept in memory whereas i changed paged from my angular app. I tried to use remove function tinymce and set global settings to null but nothing that i tried can remove editor component from the memory.

Please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox.io or similar. Capture d’écran 2022-03-03 à 10 52 16 Capture d’écran 2022-03-03 à 10 52 23

What is the expected behavior? The memory should destroy the editor component

Which versions of TinyMCE/TinyMCE-Angular, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or TinyMCE-Angular? [email protected] Capture d’écran 2022-03-03 à 10 57 03

In this closed issue it was said it was a resolved issue but why then i got memory leak from this component https://github.com/tinymce/tinymce-angular/issues/90 ?

NicolasFernandez212 avatar Mar 03 '22 09:03 NicolasFernandez212

Ref: INT-2782

exalate-issue-sync[bot] avatar Mar 03 '22 10:03 exalate-issue-sync[bot]

I have the same problem Issue90

marfyl avatar Mar 08 '22 10:03 marfyl

There's no memory leak in @tinymce/tinymce-angular. There has been a memory leak in Angular itself which was fixed in this commit https://github.com/angular/angular/commit/990067a0c6df8e97c5bbffec00a76f13c4d4c903 and shipped in Angular 14.

I just checked with the latest Angular:

@Component({
  selector: 'app-root',
  template: `
    <editor
      [init]="{
        height: 500,
        menubar: false,
        plugins: [],
        toolbar:
          'undo redo | formatselect | bold italic backcolor |        alignleft aligncenter alignright alignjustify |        bullist numlist outdent indent | removeformat | help'
      }"
    ></editor>

    <button (click)="appRef.destroy()">destroy</button>
  `,
  standalone: true,
  imports: [EditorModule],
})
export class AppComponent {
  constructor(readonly appRef: ApplicationRef) {}
}

arturovt avatar Jul 19 '22 16:07 arturovt