Ensure all handles still get released after graceful shutdown

This commit is contained in:
Stephen Halter 2015-06-12 12:49:52 -07:00 committed by Brennan
parent 31057f65bc
commit adc0310491
1 changed files with 12 additions and 0 deletions

View File

@ -153,6 +153,18 @@ namespace Microsoft.AspNet.Server.Kestrel
_post.Reference();
_post.DangerousClose();
_engine.Libuv.walk(
_loop,
(ptr, arg) =>
{
var handle = UvMemory.FromIntPtr<UvHandle>(ptr);
if (handle != _post)
{
handle.Dispose();
}
},
IntPtr.Zero);
// Ensure the "DangerousClose" operation completes in the event loop.
var ran2 = _loop.Run();