Unity-Technologies/UnityCsReference · error · ObjectDisposedException
BuiltinBakedReflectionSystem
Error message
BuiltinBakedReflectionSystem
What it means
Thrown by BuiltinBakedReflectionSystem.Tick() when the instance's 'disposed' flag is true. This is the standard ObjectDisposedException pattern: after Dispose has run (including via the finalizer), any further use of the object is rejected. Tick is the per-stage update entry point used by the reflection baking pipeline.
Source
Thrown at Editor/Mono/Camera/BuiltinBakedReflectionSystem.bindings.cs:49
bool disposed { get { return m_Ptr == IntPtr.Zero; } }
BuiltinBakedReflectionSystem()
{
m_Ptr = Internal_GetPtr();
}
#pragma warning disable UA5000 // The Avoid Finalizer Analyzer produces compile errors for any new finalizers. This pre-existing finalizer declaration has been suppressed, but should be rewritten if possible.
~BuiltinBakedReflectionSystem()
{
Dispose(false);
}
#pragma warning restore UA5000
public void Tick(SceneStateHash dependencies, IScriptableBakedReflectionSystemStageNotifier handle)
{
if (disposed)
throw new ObjectDisposedException("BuiltinBakedReflectionSystem");
m_Handle = handle;
Assert.IsNotNull(m_Handle);
Internal_Tick(dependencies);
}
public void SynchronizeReflectionProbes()
{
if (disposed)
throw new ObjectDisposedException("BuiltinBakedReflectionSystem");
Internal_SynchronizeReflectionProbes();
}
public void Clear()
{
if (disposed)View on GitHub (pinned to 225b0fbdb5)
Solutions
- Track disposal state alongside the reference and stop calling Tick after Dispose.
- Re-acquire the BuiltinBakedReflectionSystem instance from its owning system instead of reusing a stale reference.
- Null/disposed-check before invoking Tick (or wrap in try/catch for ObjectDisposedException).
Example fix
// before
system.Tick(deps, handle); // may throw if disposed
// after
if (!systemIsDisposed)
system.Tick(deps, handle); Defensive patterns
Strategy: validation
Validate before calling
if (!systemDisposed) system.Tick(deps, handle);
Try / catch
try { system.Tick(deps, handle); } catch (ObjectDisposedException) { /* re-acquire system */ } Prevention
- Invalidate cached references on Dispose.
- Re-acquire the baking system from its pipeline before use.
- Avoid retaining references across domain reloads.
When it happens
Trigger: Calling Tick(dependencies, handle) on a BuiltinBakedReflectionSystem instance that was already disposed (Dispose(true/false) ran, setting disposed=true). Typically a stale reference retained after the baking system was torn down.
Common situations: Caching the reflection system reference across an editor state change that disposes it; using a reference captured before a domain reload; logic that does not clear its handle when Dispose is called.
Related errors
- Cannot call ReportAssetChanged outside of the OnAssetsModifi
- GetRenderersFilteringResults(ReadOnlySpan<int>) is obsolete.
- rendererIDs and results NativeArrays don't match in length.
- GetRenderersHiddenResultBits(ReadOnlySpan<int>) is obsolete.
- The specified assembly file could not be found.
AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13).
Data as JSON: /api/errors/e180013146ac4aaa.
Report an issue: GitHub.