Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override Finalizer #357

Closed
thansen24 opened this issue Jan 23, 2020 · 2 comments
Closed

Override Finalizer #357

thansen24 opened this issue Jan 23, 2020 · 2 comments

Comments

@thansen24
Copy link

If I run the following sample code:

private static void Main(string[] args)
{
    const string _natsUrl = "127.0.0.1:4221";

    var connectionFactory = new NATS.Client.ConnectionFactory();

    var connection = connectionFactory.CreateConnection(_natsUrl);

    connection.Publish("PubSubTesting", ASCIIEncoding.UTF8.GetBytes("Testing!!"));
}

My console app will hang and not exit. If I change my code to dispose the connection object after Publish it will work. I assume something needs to override the finalizer and take some action to clean things up more gracefully in this case?

@watfordgnf
Copy link
Collaborator

This was fixed in #354 and should be in the next release.

@watfordgnf
Copy link
Collaborator

Duplicate of #353

@watfordgnf watfordgnf marked this as a duplicate of #353 Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants