# OnDestroy()

> Destroys this system. Any pending command buffers will be disposed, but their commands will NOT be played back.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
protected override void OnDestroy()
```

### Remarks

If you override this method, you should call `base.OnDestroy()` to retain the default destruction logic.
