Quick answer: In EndPlay, set PrimaryComponentTick.bCanEverTick = false and SetComponentTickEnabled(false). Guard tick body with IsValid(GetOwner()). Stops the warning and prevents stale-actor crashes.

Console: “TickComponent called on a component pending kill.” Component still ticking after the owning actor was destroyed.

The Symptom

Warning logs at gameplay end. Sometimes a crash if the tick body dereferences members of the now-disposed actor.

The Fix

void UMyComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
    PrimaryComponentTick.bCanEverTick = false;
    SetComponentTickEnabled(false);
    Super::EndPlay(EndPlayReason);
}

void UMyComponent::TickComponent(float dt, ELevelTick TickType, FActorComponentTickFunction* TickFunc)
{
    Super::TickComponent(dt, TickType, TickFunc);
    if (!IsValid(GetOwner())) return;

    // safe to access owner
}

Disable tick on EndPlay and guard the body. Tick removes itself from the tick groups; even if a queued tick lands, the guard catches it.

Async Code

For async tasks (HTTP, latent BP nodes) that hold a component reference, use TWeakObjectPtr in the lambda capture and validate before dereferencing. See related post.

Verifying

Destroy actors mid-tick. No more warnings. Profile shows tick count drops as actors leave.

“Disable tick in EndPlay. Validate owner. No stale ticks.”

Related Issues

For UObject GC, see UObject GC. For Replication Graph, see replication.

EndPlay disables. Validate. Tick stops.