Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 2 additions & 8 deletions projects/RabbitMQ.Client/client/RentedMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,17 @@ internal readonly ReadOnlyMemory<byte> CopyToMemory()
return new ReadOnlyMemory<byte>(Memory.ToArray());
}

private void Dispose(bool disposing)
public void Dispose()
{
if (!_disposedValue)
{
if (disposing && RentedArray != null)
if (RentedArray != null)
{
ArrayPool<byte>.Shared.Return(RentedArray);
}

_disposedValue = true;
}
}

public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
}
}
5 changes: 1 addition & 4 deletions projects/RabbitMQ.Client/client/impl/ChannelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1069,10 +1069,7 @@ await _confirmSemaphore.WaitAsync(cancellationToken)

try
{
var cmd = new BasicPublishMemory(
Encoding.UTF8.GetBytes(exchange),
Encoding.UTF8.GetBytes(routingKey),
mandatory, default);
var cmd = new BasicPublish(exchange, routingKey, mandatory, default);
using Activity sendActivity = RabbitMQActivitySource.PublisherHasListeners
? RabbitMQActivitySource.Send(routingKey, exchange, body.Length)
: default;
Expand Down