angular/packages/core/src
Krzysztof Platis b40875a2cc fix(platform-server): destroy PlatformRef when error happens during the bootstrap() phase (#58112) (#58135)
The `bootstrap()` phase might fail e.g. due to an rejected promise in some `APP_INIIALIZER`.
If `PlatformRef` is not destroyed, then the main app's injector is not destroyed and therefore `ngOnDestroy` hooks of singleton services is not called on the end (failure) of SSR.

This could lead to possible memory leaks in custom SSR apps, if their singleton services' `ngOnDestroy` hooks contained an important teardown logic (e.g. unsubscribing from RxJS observable).

Note: I needed to fix by the way another thing too: now we destroy `moduleRef` when `platformInjector` is destroyed - by setting a `PLATFORM_DESTROY_LISTENER`

Patch port of #58112

PR Close #58135
2024-10-09 13:50:02 +00:00
..
application refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
authoring refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
change_detection refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
compiler refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
debug refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
defer refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
di refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
hydration refactor(core): Remove global event delegation code. (#57893) 2024-09-26 14:18:18 -07:00
i18n refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
interface refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
linker refactor(core): drop ViewRefTracker in favor of ApplicationRef. (#58096) 2024-10-08 13:25:24 -07:00
metadata refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
platform fix(platform-server): destroy PlatformRef when error happens during the bootstrap() phase (#58112) (#58135) 2024-10-09 13:50:02 +00:00
reflection refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
render refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
render3 fix(core): clean up afterRender after it is executed (#58119) 2024-10-08 13:27:07 -07:00
sanitization refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
testability refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
util refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
view refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
zone refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
authoring.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
cached_injector_service.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
change_detection.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
console.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
core.externs.js refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
core.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
core_private_export.ts refactor(core): Remove global event delegation code. (#57893) 2024-09-26 14:18:18 -07:00
core_reactivity_export.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
core_reactivity_export_internal.ts fix(upgrade): support input signal bindings (#57020) 2024-09-26 14:14:15 -07:00
core_render3_private_export.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
di.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
error_details_base_url.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
error_handler.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
errors.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
event_delegation_utils.ts refactor(core): Remove global event delegation code. (#57893) 2024-09-26 14:18:18 -07:00
event_emitter.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
image_performance_warning.ts fix(common): prevent warning about oversize image twice (#58021) 2024-10-02 11:46:18 +00:00
linker.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
metadata.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
pending_tasks.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
r3_symbols.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
render.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
transfer_state.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
version.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
zone.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00