Facepunch / sbox-sdf

Library providing marching cubes / squares mesh generation
MIT License
15 stars 7 forks source link

NullReferenceException in SdfChunk.ClearAsync #31

Closed trundlr closed 4 months ago

trundlr commented 4 months ago

I don't fully understand the context or reasoning behind this error:

Object reference not set to an instance of an object.
Sandbox.Component.get_Task
Sandbox.Sdf.SdfChunk`6.ClearAsync(SdfChunk.cs:137)
Sandbox.Sdf.SdfWorld`6+<<ClearImpl>b__56_2>d.MoveNext(SdfWorld.cs:387)
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
Sandbox.TaskSource+<WhenAll>d__41.MoveNext
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
Sandbox.Sdf.SdfWorld`6+<ClearImpl>d__56.MoveNext(SdfWorld.cs:385)
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
Sandbox.Sdf.SdfWorld`6+<ClearAsync>d__55.MoveNext(SdfWorld.cs:369)

It happens to most users. I will try to triage when this error occurs and any other context that may be helpful to resolving this, and update this issue with it.

Metapyziks commented 4 months ago

Should be fixed now, I shouldn't have been doing async cleanup when the world gets destroyed.