diff --git a/packages/core/src/linker/destroy_ref.ts b/packages/core/src/linker/destroy_ref.ts index cf76a2e95ab..5202c16cb0c 100644 --- a/packages/core/src/linker/destroy_ref.ts +++ b/packages/core/src/linker/destroy_ref.ts @@ -12,8 +12,6 @@ import {LView} from '../render3/interfaces/view'; import {getLView} from '../render3/state'; import {removeLViewOnDestroy, storeLViewOnDestroy} from '../render3/util/view_utils'; -const EXECUTE_CALLBACK_IF_ALREADY_DESTROYED = false; - /** * `DestroyRef` lets you set callbacks to run for any cleanup or destruction behavior. * The scope of this destruction depends on where `DestroyRef` is injected. If `DestroyRef` @@ -84,12 +82,6 @@ export class NodeInjectorDestroyRef extends DestroyRef { override onDestroy(callback: () => void): () => void { const lView = this._lView; - // TODO(atscott): Remove once g3 cleanup is complete - if (EXECUTE_CALLBACK_IF_ALREADY_DESTROYED && isDestroyed(lView)) { - callback(); - return () => {}; - } - storeLViewOnDestroy(lView, callback); return () => removeLViewOnDestroy(lView, callback); }