I think I'm having some big memory leaks related to the CKeditor setData() function. I have a web app where users can design their own content with Javascript. CKEditor is used as the WYSIWYG editor for the users to write content of each part of the design.
Each time a user click on a editable text-element in their design, editor.setData is called, and it sets the CKEditor data to whatever is within the text element of the users design that is being clicked.
This works fine for a few times, but each time a user click a new text element, and .setData() is called, the app gets slower, slower and slower, until the website crashes. I've tried disabling setData() function in my Javascript and I have no memory leaks or performance issues when I do so.
Anyone had similar issues? Anyone have any advice of how I can avoid this memory leak and performance loss?
The function that is being called, and that create the performance loss is:
function clickTextElement() {
var location = $(this);
$('.selected').removeClass('selected');
location.addClass('selected');
$('#main-tools').hide();
if(location.hasClass('textarea')){
$('#imageeditor').hide();
$('#texteditor').show();
editor.setData( $('.selected').html() );
}
}