Struct GhostCollectionCleanupSystem
Disabled system that exists to cleanup persistently allocated state in a temp baking world. This will properly dispose of allocations inside any orphan CodeGhostPrefab blobs.
Implements
ISystem
Inherited Members
Namespace: Unity.Netcode
Assembly: Unity.NetCode.dll
Syntax
[BurstCompile]
public struct GhostCollectionCleanupSystem : ISystem
Remarks
We use temp baking worlds in a few places that never create the GhostCollectionSystem. ConvertToGhostPrefab(EntityManager, Entity, Config, NativeParallelHashMap<Component, ComponentOverride>) makes a persistent allocation as it bakes a prefab. Normally, OnDestroy(ref SystemState) cleans up those allocations, but if we have a world without a GhostCollectionSystem, the persistant allocations causes memory leaks.
Methods
OnCreate(ref SystemState)
Declaration
public void OnCreate(ref SystemState state)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemState | state |
OnDestroy(ref SystemState)
Declaration
public void OnDestroy(ref SystemState state)
Parameters
| Type | Name | Description |
|---|---|---|
| SystemState | state |
Implements
ISystem