Opened 8 years ago
Last modified 8 years ago
#14922 confirmed Bug
event listeners leak between each setData
Reported by: | XipanXiao | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Performance | Version: | 4.0 |
Keywords: | Cc: |
Description
Steps to reproduce
- Switch the editor content by setting editor.data.
- Repeat it many times and the CPU usage grows to 100%.
Expected result
Actual result
Other details (browser, OS, CKEditor version, installed plugins)
There are at least two identified source of leaks:
- the clipboard plugin: a 'destroy' event listener is added each time content is loaded but never recycled.
(http://docs.ckeditor.com/source/plugin13.html)
editor.on( 'contentDom', addPasteListenersToEditable ); function addPasteListenersToEditable() {
... editor.on( 'destroy', function() {
clearTimeout( mouseupTimeout );
} );
}
- the magicline plugin: https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/magicline/plugin.js#L277 But for this one I think I'll have to create a bug for them, not for you.
==
Change History (2)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Keywords: | object leak removed |
---|---|
Status: | new → confirmed |
Version: | 4.5.11 → 4.0 |
Thank you for pointing this out as well as areas we should look at. Problem can be reproduced from CKEditor 4.0 at least.
for the magicline plugin, the offending code is:
editor.on( 'loadSnapshot', function() {
});
This is called from within the callback of contentDom, which adds a loadSnapshot listener every time editor.data is set but never recycled.