Skip to content

Commit

Permalink
Fixes ProjectContainer static reference
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavopsantos committed Mar 20, 2024
1 parent df2422f commit 28d499d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Assets/Reflex/Injectors/UnityInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ private static void BeforeAwakeOfFirstSceneOnly()
ReportReflexDebuggerStatus();

ContainersPerScene.Clear();
var projectContainer = CreateProjectContainer();
ProjectContainer = CreateProjectContainer();

void InjectScene(Scene scene)
{
ReflexLogger.Log($"Scene {scene.name} ({scene.GetHashCode()}) loaded", LogLevel.Development);
var sceneContainer = CreateSceneContainer(scene, projectContainer);
var sceneContainer = CreateSceneContainer(scene, ProjectContainer);
ContainersPerScene.Add(scene, sceneContainer);
SceneInjector.Inject(scene, sceneContainer);
}
Expand All @@ -48,7 +48,7 @@ void DisposeScene(Scene scene)

void DisposeProject()
{
ProjectContainer?.Dispose();
ProjectContainer.Dispose();
ProjectContainer = null;

// Unsubscribe from static events ensuring that Reflex works with domain reloading set to false
Expand Down

0 comments on commit 28d499d

Please sign in to comment.