ssannandeji / Zenject-2019

Dependency Injection Framework for Unity3D
MIT License
2.53k stars 363 forks source link

MissingReferenceException in MonoPoolableMemoryPool.OnDespawned(T item) when exiting play mode #599

Open taylank opened 5 years ago

taylank commented 5 years ago

I don't know whether this is an issue for builds, but I keep getting MissingReferenceException (trying to access object that is already destroyed) in the OnDespawned(T item) method of MonoPoolableMemoryPool, when I exit play mode in the editor. Maybe a race condition when the scene is unloaded? A simple null check within that method resolves the issue.

svermeulen commented 5 years ago

I think this is more an issue with when you are triggering the OnDespawned event rather than an issue with MonoPoolableMemoryPool. How are you triggering OnDespawned?