-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Description
Entering text using fromTextArea seems to cause a memory leak.
I checked this in Chrome.
Video showing the memory leak.
Source Code.
<html>
<head>
<link rel="stylesheet" href="./codemirror-5.57.0/lib/codemirror.css">
<script src="./codemirror-5.57.0/lib/codemirror.js"></script>
</head>
<body>
<textarea id="targetTextarea" cols="30" rows="10"></textarea>
<br><br><div id="add">codemirror add</div>
<br><div id="remove">codemirror remove</div>
<script>
let codemirror = undefined;
let targetTextareaEl = undefined;
let addEl = undefined;
let removeEl = undefined;
window.onload = function(){
targetTextareaEl = document.querySelector('#targetTextarea');
addEl = document.querySelector('#add');
removeEl = document.querySelector('#remove');
addEl.addEventListener('click', () => {
if(!codemirror) {
codemirror = CodeMirror.fromTextArea(targetTextareaEl);
}
});
removeEl.addEventListener('click', () => {
if(codemirror){
codemirror.toTextArea();
}
codemirror = undefined;
});
}
</script>
</body>
</html>Adding characters by paste or deleting characters by delete key did not leak the memory
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
