Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  [FIXED] Dispose of atomic safety handle error when game start
#2
(01-12-2023, 03:22 AM)kaser Wrote:
Code:
System.ObjectDisposedException: The UNKNOWN_OBJECT_TYPE has been deallocated, it is not allowed to access it
  at (wrapper managed-to-native) Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckDeallocateAndThrow_Injected(Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle&)
  at Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckDeallocateAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) [0x00000] in <b41119cc6741409ea29f63c7f98de938>:0
  at Obi.ObiNativeList`1[T].Dispose (System.Boolean disposing) [0x0003f] in ....\Standard Assets\Vendor\Obi\Scripts\Common\DataStructures\NativeList\ObiNativeList.cs
[color=#1a1a1a][size=small][font=-apple-system, BlinkMacSystemFont,][color=#242424][size=small][font=-apple-system, BlinkMacSystemFont,]

Hi, I got an error message after game start while using the Obi , as shown above.


Hi,

I'm unable to reproduce this. Could you describe under what situations does this happen?

(01-12-2023, 03:22 AM)kaser Wrote: Please help me to fix this error

This error is raised by Unity's job safety system. If it only happens in the editor, disabling the safety checks in the Jobs menu should get rid of it. This is of course not ideal, but shouldn't affect runtime behavior.

(01-12-2023, 03:22 AM)kaser Wrote: I checked the error code and found strange parts. 
The Dispose process used Bool, but it was not actually used in the Function
Therefore, I added a correction, but I am not sure if this correction is correct. 
After more digging . I think Obi's implementation of Create and Dispose may have missed implementations, resulting in Dispose not running properly.
If anyone is also investigating, welcome to join

https://learn.microsoft.com/en-us/dotnet...ng-dispose

The boolean parameter in Dispose(bool) lets you know whether the method is called by a finalizer (similar to a destructor in C/C++) or by manually calling the Dispose() method. In both cases we need to release the safety handle, so the correct thing in this case is to ignore the parameter.
Reply


Messages In This Thread
RE: Dispose of atomic safety handle error when game start - by josemendez - 01-12-2023, 06:36 AM