Skip to content

Commit

Permalink
Merge branch 't/13850'
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Oct 23, 2015
2 parents 8eb2434 + 2b3093b commit 74aa134
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugins/wysiwygarea/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,17 +508,25 @@
detach: function() {
var editor = this.editor,
doc = editor.document,
iframe = editor.window.getFrame(),
iframe,
onResize;

// Trying to access window's frameElement property on Edge throws an exception
// when frame was already removed from DOM. (#13850, #13790)
try {
iframe = editor.window.getFrame();
} catch ( e ) {}

framedWysiwyg.baseProto.detach.call( this );

// Memory leak proof.
this.clearCustomData();
doc.getDocumentElement().clearCustomData();
CKEDITOR.tools.removeFunction( this._.frameLoadedHandler );

if ( iframe ) {
// On IE, iframe is returned even after remove() method is called on it.
// Checking if parent is present fixes this issue. (#13850)
if ( iframe && iframe.getParent() ) {
iframe.clearCustomData();
onResize = iframe.removeCustomData( 'onResize' );
onResize && onResize.removeListener();
Expand Down

0 comments on commit 74aa134

Please sign in to comment.