Don't dispose the server anymore, the container does it
This commit is contained in:
parent
8f5f8d28d0
commit
933a2f5a1d
|
|
@ -212,7 +212,6 @@ namespace Microsoft.AspNetCore.Hosting.Internal
|
||||||
{
|
{
|
||||||
_logger?.Shutdown();
|
_logger?.Shutdown();
|
||||||
_applicationLifetime.StopApplication();
|
_applicationLifetime.StopApplication();
|
||||||
Server?.Dispose();
|
|
||||||
(_applicationServices as IDisposable)?.Dispose();
|
(_applicationServices as IDisposable)?.Dispose();
|
||||||
_applicationLifetime.NotifyStopped();
|
_applicationLifetime.NotifyStopped();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
|
|
||||||
host.Dispose();
|
host.Dispose();
|
||||||
|
|
||||||
Assert.Equal(2, _startInstances[0].DisposeCalls); // Once as the server, once from the DI Container
|
Assert.Equal(1, _startInstances[0].DisposeCalls);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
@ -157,7 +157,7 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
// Wait on the host to shutdown
|
// Wait on the host to shutdown
|
||||||
lifetime.ApplicationStopped.WaitHandle.WaitOne();
|
lifetime.ApplicationStopped.WaitHandle.WaitOne();
|
||||||
|
|
||||||
Assert.Equal(2, _startInstances[0].DisposeCalls); // Once as the server, once from the DI Container
|
Assert.Equal(1, _startInstances[0].DisposeCalls);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue