# Ensure "Owner is not selected" when a selected component is destroyed via DestroyComponent() 

**URL:** <https://forums.unrealengine.com/t/ensure-owner-is-not-selected-when-a-selected-component-is-destroyed-via-destroycomponent/2744463>\
**Category:** Issues and Bug Reporting (Unreal Engine)\
**Tags:** unreal-engine\
**Created:** [August 17, 2026, 5:56pm UTC](https://forums.unrealengine.com/t/ensure-owner-is-not-selected-when-a-selected-component-is-destroyed-via-destroycomponent/2744463 "2026-08-17T17:56:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![e8c82ec0ba374682912ad5e9fad71a2d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@e8c82ec0ba374682912ad5e9fad71a2d](https://forums.unrealengine.com/u/e8c82ec0ba374682912ad5e9fad71a2d)\
**Post date:** [August 17, 2026, 5:56pm UTC](https://forums.unrealengine.com/t/ensure-owner-is-not-selected-when-a-selected-component-is-destroyed-via-destroycomponent/2744463/1 "2026-08-17T17:56:33Z")

</div>

### Summary

Ensure “Owner (…) is not selected” fires in FComponentElementSelectionInterface / gizmo recalculation (GetNormalizedElements) when a scene component is destroyed programmatically while it is selected in the editor viewport, because the destroyed component is not removed from the editor’s component selection set.

When an actor (or a component subtree) is destroyed programmatically — e.g. via AActor::Destroy() or UActorComponent::DestroyComponent() called from game code, editor utilities, or PostLoad cleanup — while one of its scene components is selected in the Level Editor, the owner actor is removed from the selection set but the selected child scene components remain in GEditor-\>GetSelectedComponents().  
The next time the viewport recalculates the transform gizmo (GetNormalizedElements), the stale selection triggers the ensure:  
Ensure condition failed: … Owner (…) is not selected  
Editor-driven deletion paths (Outliner delete, UUnrealEdEngine::DeleteActors, undo/redo transactions) correctly clean up the selection set, but programmatic destruction via the public DestroyComponent() API does not. Since DestroyComponent() is a public API that can legitimately be called at any time, UActorComponent::OnComponentDestroyed() (or the selection system) should defensively deselect the component and its children.  
As a workaround, we currently override OnComponentDestroyed() in our components and manually call USelection::Deselect() for the component and all of its child scene components before destruction.

### What Type of Bug are you experiencing?

Editor

### Steps to Reproduce

1. Create an actor with a custom scene component hierarchy (e.g. a root component with child mesh components).
2. Place the actor in a level.
3. Select one of the child scene components in the Level Editor viewport or the Details panel component tree.
4. Destroy the component (or its owner actor) from code — for example, call DestroyComponent() from a console command, an editor utility, or during PIE on the editor-world instance.
5. Move the mouse over the viewport or interact with the transform gizmo so the selection is re-evaluated.

### Expected Result

The destroyed component is automatically removed from the editor component selection set. No ensure is triggered, and the gizmo updates gracefully.

### Observed Result

The destroyed (trashed / garbage) component remains in the component selection set. The ensure “Owner (…) is not selected” fires during gizmo normalization (GetNormalizedElements), and the selection/gizmo state becomes inconsistent until the user clicks to reselect something.

### Affects Versions

5.4

### Platform(s)

Windows
