Skip to content

Commit

Permalink
Fix memory leak caused by not detaching event handler (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Osborn authored Aug 28, 2024
1 parent 220f2da commit dc5c88d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
6 changes: 0 additions & 6 deletions RabbitMQ.Stream.Client/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public record ClientParameters
public delegate Task MetadataUpdateHandler(MetaDataUpdate update);

public event MetadataUpdateHandler OnMetadataUpdate;
public Action<Exception> UnhandledExceptionHandler { get; set; } = _ => { };
public TimeSpan Heartbeat { get; set; } = TimeSpan.FromMinutes(1);

public string ClientProvidedName
Expand Down Expand Up @@ -164,11 +163,6 @@ private Client(ClientParameters parameters, ILogger logger = null)
IsClosed = false;
_logger = logger ?? NullLogger.Instance;
ClientId = Guid.NewGuid().ToString();
AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
{
_logger.LogError(args.ExceptionObject as Exception, "Unhandled exception");
Parameters.UnhandledExceptionHandler(args.ExceptionObject as Exception);
};
}

public bool IsClosed
Expand Down
2 changes: 0 additions & 2 deletions RabbitMQ.Stream.Client/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ RabbitMQ.Stream.Client.ClientParameters.Password.set -> void
RabbitMQ.Stream.Client.ClientParameters.Properties.get -> System.Collections.Generic.IDictionary<string, string>
RabbitMQ.Stream.Client.ClientParameters.Ssl.get -> RabbitMQ.Stream.Client.SslOption
RabbitMQ.Stream.Client.ClientParameters.Ssl.set -> void
RabbitMQ.Stream.Client.ClientParameters.UnhandledExceptionHandler.get -> System.Action<System.Exception>
RabbitMQ.Stream.Client.ClientParameters.UnhandledExceptionHandler.set -> void
RabbitMQ.Stream.Client.ClientParameters.UserName.get -> string
RabbitMQ.Stream.Client.ClientParameters.UserName.set -> void
RabbitMQ.Stream.Client.ClientParameters.VirtualHost.get -> string
Expand Down

0 comments on commit dc5c88d

Please sign in to comment.