Opened 9 years ago

Last modified 8 years ago

#6203 confirmed Bug

Uncaught exception: TypeError: Cannot convert 'K' to object on editor.destroy();

Reported by: Tony Owned by:
Priority: Normal Milestone:
Component: General Version: 3.4
Keywords: HasPatch Cc:

Description

I receive the following error when trying to destroy a CKeditor 3.4 instance using a plugin :

Uncaught exception: TypeError: Cannot convert 'K' to object
Error thrown at line 92, column 1741 in <anonymous function: getSnapshotData>():
    return K.getFrameDocument().getBody().getHtml();
called from line 114, column 4746 in <anonymous function: init>(o):
    o.data=l(n).getSnapshotData();
called via Function.prototype.call() from line 6, column 3258 in <anonymous function: on>(o, p, q, r):
    var s={name:d,sender:this,editor:o,data:p,listenerData:g,stop:q,cancel:r,removeListener:function(){l.removeListener(d,e);}};
called via Function.prototype.call() from line 6, column 4027 in <anonymous function: fire>(h, i, j):
    d=f=false;
called via Function.prototype.call() from unknown location in <anonymous function: fire>(b, c):
    /* no source available */
called from line 24, column 4875 in <anonymous function: getSnapshot>():
    var l=this.fire('getSnapshot');
called from line 87, column 1760 in <anonymous function: j.undo.Image>(r):
    var s=r.getSnapshot(),t=s&&r.getSelection();
called from line 88, column 831 in <anonymous function: save>(r, s, t):
    s=new l(v.editor);
called from line 87, column 277 in v(w):
    s.save();
called via Function.prototype.call() from line 6, column 3258 in <anonymous function: on>(o, p, q, r):
    var s={name:d,sender:this,editor:o,data:p,listenerData:g,stop:q,cancel:r,removeListener:function(){l.removeListener(d,e);}};

I guess that CKeditor's snapshot attempt is being fired after the editor has been destroyed? I have attached a small test plugin to make it easy to reproduce. The error was caught using Opera. The editor does destroy but the error message means not cleanly at a guess.

Attachments (2)

editorClose.zip (977 bytes) - added by Tony 9 years ago.
editor close test plugin for CKeditor
6203.patch (2.0 KB) - added by Garry Yao 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by Tony

Attachment: editorClose.zip added

editor close test plugin for CKeditor

comment:1 Changed 9 years ago by Krzysztof Studnik

Keywords: destroy cannot convert 'K' removed

comment:2 Changed 8 years ago by Garry Yao

Status: newconfirmed

It's impossible to guarantee absolute safety on destroyed instance since we're using a closure for referencing the "editor" variable all through our codes, considering this not a big issue we should just claim this as a convention in our API documentation.

Note: All instance methods of "CKEDITOR.editor" invocation is invalid after editor instance destroyed with "CKEDITOR.editor::destroy".

But we should at least error free for the attached TC.

Changed 8 years ago by Garry Yao

Attachment: 6203.patch added

comment:3 Changed 8 years ago by Garry Yao

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