Skip to content

Commit 86d354e

Browse files
committed
Merge branch 't/10219b'
2 parents 1aa6e75 + 77cc81a commit 86d354e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CKEditor 4 Changelog
44
## CKEditor 4.1.1
55

66
* [#10172](http://dev.ckeditor.com/ticket/10172): Pressing delete/backspace in empty table cell moves cursor to next/previous cell.
7+
* [#10219](http://dev.ckeditor.com/ticket/10219): Error thrown when destroying an instance in parallel with a mouseup event.
78

89
## CKEditor 4.1
910

plugins/clipboard/plugin.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,15 +477,24 @@
477477
!preventBeforePasteEvent && fixCut( editor );
478478
});
479479

480+
var mouseupTimeout;
481+
480482
// Use editor.document instead of editable in non-IEs for observing mouseup
481483
// since editable won't fire the event if selection process started within
482484
// iframe and ended out of the editor (#9851).
483485
editable.attachListener( CKEDITOR.env.ie ? editable : editor.document.getDocumentElement(), 'mouseup', function() {
484-
setTimeout( function() {
486+
mouseupTimeout = setTimeout( function() {
485487
setToolbarStates();
486488
}, 0 );
487489
});
488490

491+
// Make sure that deferred mouseup callback isn't executed after editor instance
492+
// had been destroyed. This may happen when editor.destroy() is called in parallel
493+
// with mouseup event (i.e. a button with onclick callback) (#10219).
494+
editor.on( 'destroy', function() {
495+
clearTimeout( mouseupTimeout );
496+
});
497+
489498
editable.on( 'keyup', setToolbarStates );
490499
}
491500

0 commit comments

Comments
 (0)