Fix #99316. Clear context when notebook is being removed from DOM.

This commit is contained in:
rebornix 2020-06-03 14:51:56 -07:00
parent 90a39ba0d4
commit 8fc68f7974

View file

@ -141,6 +141,9 @@ export class NotebookEditor extends BaseEditor {
// make sure the editor widget is removed from the view
const existingEditorWidgetForInput = NotebookRegistry.getNotebookEditorWidget(this.input as NotebookEditorInput);
if (existingEditorWidgetForInput) {
// the editor widget is only referenced by the editor input
// clear its state
existingEditorWidgetForInput?.onWillHide();
existingEditorWidgetForInput?.getDomNode().remove();
existingEditorWidgetForInput?.dispose();
NotebookRegistry.releaseNotebookEditorWidget(this.input as NotebookEditorInput);