Fix eventService memory leaks (#9752)

* fix leak by unbinding event from $rootscope

* destroy more events

* $scope unavailable

* no need to destroy in services as they are singletons

Co-authored-by: nzdev <nzdev@github.com>
Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
This commit is contained in:
Chad
2021-02-08 12:56:56 +13:00
committed by GitHub
parent 55124fff81
commit 06e5d07650
9 changed files with 32 additions and 13 deletions

View File

@@ -507,8 +507,10 @@
vm.showPaste = clipboardService.hasEntriesOfType(clipboardService.TYPES.ELEMENT_TYPE, contentTypeAliases);
}
eventsService.on("clipboardService.storageUpdate", checkAbilityToPasteContent);
var storageUpdate = eventsService.on("clipboardService.storageUpdate", checkAbilityToPasteContent);
$scope.$on('$destroy', function () {
storageUpdate();
});
var notSupported = [
"Umbraco.Tags",
"Umbraco.UploadField",