Code Editor: Remove keeping track of wp.codeEditor instances since unused and no removal of instances upon deletion, leading to memory leak.

See #12423.

Built from https://develop.svn.wordpress.org/trunk@41852


git-svn-id: http://core.svn.wordpress.org/trunk@41686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter
2017-10-13 04:34:52 +00:00
parent 0659de4e21
commit d44acf01dc
3 changed files with 2 additions and 13 deletions

View File

@@ -25,14 +25,6 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
onUpdateErrorNotice: function() {}
};
/**
* All instances of code editors.
*
* @since 4.9.0
* @type {Array.<CodeEditorInstance>}
*/
wp.codeEditor.instances = [];
/**
* Configure linting.
*
@@ -252,9 +244,6 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
codemirror: codemirror
};
// Keep track of the instances that have been created.
wp.codeEditor.instances.push( instance );
if ( codemirror.showHint ) {
codemirror.on( 'keyup', function( editor, event ) { // eslint-disable-line complexity
var shouldAutocomplete, isAlphaKey = /^[a-zA-Z]$/.test( event.key ), lineBeforeCursor, innerMode, token;