hadashiA / VContainer

The extra fast, minimum code size, GC-free DI (Dependency Injection) library running on Unity Game Engine.
https://vcontainer.hadashikick.jp
MIT License
1.92k stars 167 forks source link

Fix for usage of ListBuffer to be properly released #681

Closed Raegan03 closed 3 months ago

Raegan03 commented 3 months ago

When checking the VContainer implementation I've found that ListBuffer is used incorrectly in two instances. The list is being provided by the pool but it's never released to it. I've made a quick fix using BufferScope to properly dispose of and release the list back to the pool.

I've done a test with LifetimeScope:Find<T>(Scene scene) and for 1000 calls only one list was created as expected.

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vcontainer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2024 2:15pm
hadashiA commented 3 months ago

Thanks!