Skip to content

Commit 14fc90d

Browse files
committed
Merge pull request #26 from Rocketmakers/initialize-race-condition
Fix bootstrap initialization race condition
2 parents 46f4446 + 38ceb3e commit 14fc90d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Ninject.Web.Common.OwinHost/OwinBootstrapper.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ public async Task Execute(IOwinContext context, Func<Task> next)
8383
{
8484
if (this.bootstrapper == null)
8585
{
86-
this.bootstrapper = new Bootstrapper();
87-
this.bootstrapper.Initialize(this.CreateKernel);
86+
var initializingBootstrapper = new Bootstrapper();
87+
initializingBootstrapper.Initialize(this.CreateKernel);
88+
this.bootstrapper = initializingBootstrapper;
8889
}
8990
}
9091
}

0 commit comments

Comments
 (0)