Skip to content

Commit fe27890

Browse files
Avoid disposing invalid handle
1 parent 3be2a4e commit fe27890

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Servers/HttpSys/src/NativeInterop/RequestQueue.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,13 @@ public void Dispose()
180180

181181
_disposed = true;
182182

183+
// Close the request queue handle first to cancel any pending IO operations.
184+
// This must happen before disposing BoundHandle, as pending operations need
185+
// to be cancelled and cleaned up using the BoundHandle.
183186
PInvoke.HttpCloseRequestQueue(Handle);
184187

185188
BoundHandle.Dispose();
186-
Handle.Dispose();
189+
Handle.SetHandleAsInvalid();
187190
}
188191

189192
private void CheckDisposed()

0 commit comments

Comments
 (0)