Code Editor: Remove keeping track of `wp.codeEditor` instances since unused and no removal of instances upon deletion, leading to memory leak.
See #12423. git-svn-id: https://develop.svn.wordpress.org/trunk@41852 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8bf9afb4f4
commit
27a33509fb
|
@ -25,14 +25,6 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
|
||||||
onUpdateErrorNotice: function() {}
|
onUpdateErrorNotice: function() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* All instances of code editors.
|
|
||||||
*
|
|
||||||
* @since 4.9.0
|
|
||||||
* @type {Array.<CodeEditorInstance>}
|
|
||||||
*/
|
|
||||||
wp.codeEditor.instances = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure linting.
|
* Configure linting.
|
||||||
*
|
*
|
||||||
|
@ -252,9 +244,6 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
|
||||||
codemirror: codemirror
|
codemirror: codemirror
|
||||||
};
|
};
|
||||||
|
|
||||||
// Keep track of the instances that have been created.
|
|
||||||
wp.codeEditor.instances.push( instance );
|
|
||||||
|
|
||||||
if ( codemirror.showHint ) {
|
if ( codemirror.showHint ) {
|
||||||
codemirror.on( 'keyup', function( editor, event ) { // eslint-disable-line complexity
|
codemirror.on( 'keyup', function( editor, event ) { // eslint-disable-line complexity
|
||||||
var shouldAutocomplete, isAlphaKey = /^[a-zA-Z]$/.test( event.key ), lineBeforeCursor, innerMode, token;
|
var shouldAutocomplete, isAlphaKey = /^[a-zA-Z]$/.test( event.key ), lineBeforeCursor, innerMode, token;
|
||||||
|
|
Loading…
Reference in New Issue