In my angular application I have used 7 instances of ckeditor to display 7 different fields of a question. It is quiz application. I have to iterate the question set for each quiz question. I have put the questions in ngfor. So I guess for each question 7 instances will be created. This is resulting in memory leak. I have 30 questions in the quick, after attending each question, I can see the overall memory usage increases by 200MB. After 5 questions my browsers memory usage was at around 1.2GB.
So I decided to delete the instances manually after each question, using destroy() method of ckeditor.
It shows following error:
core.mjs:6480 ERROR Error: Uncaught (in promise): TypeError: this.data.get is not a function
TypeError: this.data.get is not a function
at PD.updateSourceElement (elementapimixin.js:39:51)
at PD.destroy (classiceditor.js:98:9)
at CKEditorComponent.<anonymous> (ckeditor-ckeditor5-angular.js:243:1)
at Generator.next (<anonymous>)
at tslib.es6.js:76:1
at ZoneAwarePromise (zone.js:1387:1)
at __awaiter (tslib.es6.js:72:1)
at EditorWatchdog.destructor [as _destructor] (ckeditor-ckeditor5-angular.js:242:49)
at editorwatchdog.js:238:1
at ZoneDelegate.invoke (zone.js:372:1)
at resolvePromise (zone.js:1213:1)
at zone.js:1120:1
at rejected (tslib.es6.js:74:89)
at ZoneDelegate.invoke (zone.js:372:1)
at Object.onInvoke (core.mjs:25850:1)
at ZoneDelegate.invoke (zone.js:371:1)
at Zone.run (zone.js:134:1)
at zone.js:1276:1
at ZoneDelegate.invokeTask (zone.js:406:1)
at Object.onInvokeTask (core.mjs:25837:1)
Is this a known issue in ckeditor? How can I delete the current instances of ckeditor. If it is not not possible, is there a way to reuse same set of instances for each question?
The destroy() is throwing error. It should delete the current instances of ckeditor to avoid leaking memory.