Opened 11 years ago
Closed 11 years ago
#11295 closed Bug (duplicate)
can't destroy before setData has finished
Reported by: | tepez | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
When calling instance.destroy()
before instance.setData()
has finished there is an error.
This is illustrated here: http://jsfiddle.net/sSPe7/1/
Change History (3)
comment:1 Changed 11 years ago by
Summary: | destroy has to wait for setData → can't destroy before setData has finished |
---|
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
This is a duplicate of #11502 and will be closed as such.
We are going to try to solve this in CKEditor 5 (If it will be possible). In CKEditor 4 developer is obligated to api to control this.
Currently it is hard to stop all running processes when they were started (both are complicated) that is why there are events that you should use in such cases - http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-afterSetData, http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-instanceReady.
There is even no need to call setData() to provoke the error. Simply calling destroy() immediately after creation produces the same error.
http://jsfiddle.net/sSPe7/2/