Unbind listener

Listening for splitViewRequest was only unbound if the split view editor was opened. Not cleaning up the listener caused a memory leak when changing between nodes as the spit view editor was detached but not garbage-collected
This commit is contained in:
Nathan Woulfe
2021-03-19 11:15:09 +10:00
committed by Michael Latouche
parent 88611f30b5
commit 95bf10e11b

View File

@@ -202,6 +202,9 @@
splitViewChanged();
unbindSplitViewRequest();
}
// if split view was never closed, the listener is not disposed when changing nodes - this unbinds it
$scope.$on('$destroy', () => unbindSplitViewRequest());
/**
* Changes the currently selected variant