Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Servers/HttpSys/src/NativeInterop/RequestQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,13 @@ public void Dispose()

_disposed = true;

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

BoundHandle.Dispose();
Handle.Dispose();
Handle.SetHandleAsInvalid();
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After Handle.SetHandleAsInvalid(), consider still calling Handle.Dispose() to suppress the SafeHandle finalizer and release managed resources; disposal should be a no-op for the native handle once it’s marked invalid.

Suggested change
Handle.SetHandleAsInvalid();
Handle.SetHandleAsInvalid();
Handle.Dispose();

Copilot uses AI. Check for mistakes.
}

private void CheckDisposed()
Expand Down
Loading