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.81k stars 157 forks source link

RootLifetimeScope registers 2 times when starting a scene #648

Closed SipiRaussi closed 3 months ago

SipiRaussi commented 4 months ago

Everything that is registered in RootLifetimeScope gets instantiated 2 times when scene is started. Even when they are registered with Lifetime.Singleton

Context

TestService implements IInitializable interface TestDependency is bare C# class VContainerSettings is assigned to be preloaded in project settings

Unity version: 2022.3.20f1 VContainer version: 1.15.1

image

SipiRaussi commented 3 months ago

This doesn't happen in version 1.14

hadashiA commented 3 months ago

Hello, thanks for the report. This problem seems to occur probably only in editor. I have been fixed in #650.