You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When simultaneously using PlaceholderFactory and IPoolable, if you override the Create method of PlaceholderFactory and create instances using Container.Instantiate instead of base.Create(), it will result in the IMemoryPool instance not being assigned. However, if you create instances using base.Create(), it will be correctly assigned.
publicclassTestMono:MonoBehaviour{publicSonSon;privateBase.TestFactoryfactory;[Inject]publicvoidInitialization(Base.TestFactoryfactory){this.factory=factory;}privatevoidStart(){Basetemp=factory.Create(TestType.Base);temp.Dispose();//throw NullReferenceException here because pool is null}}
Expected behavior
How can I temporarily mitigate the impact of this issue? My project requires both a memory pool and the Create() method of the factory. While solely using the memory pool and not the factory might avoid this problem, I'm personally not fond of directly using memory pools. It would be preferable to have a better solution.
Extenject and Unity info (please complete the following information):
Zenject version: 9.2.0
Unity version: 2020.3.24.f1
Project's scripting backend: Mono
The text was updated successfully, but these errors were encountered:
Describe the bug
When simultaneously using PlaceholderFactory and IPoolable, if you override the Create method of PlaceholderFactory and create instances using Container.Instantiate instead of base.Create(), it will result in the IMemoryPool instance not being assigned. However, if you create instances using base.Create(), it will be correctly assigned.
To Reproduce
Code here:
Expected behavior
How can I temporarily mitigate the impact of this issue? My project requires both a memory pool and the Create() method of the factory. While solely using the memory pool and not the factory might avoid this problem, I'm personally not fond of directly using memory pools. It would be preferable to have a better solution.
Extenject and Unity info (please complete the following information):
The text was updated successfully, but these errors were encountered: