Opened 3 years ago

Last modified 3 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

  1. Switch the editor content by setting editor.data.
  2. 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:

  1. 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 );

} );

}

  1. 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 3 years ago by XipanXiao

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.

comment:2 Changed 3 years ago by Jakub Ś

Keywords: object leak removed
Status: newconfirmed
Version: 4.5.114.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.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy