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

DigestAuthenticator should implement IDisposable #28

Open
highfield opened this issue May 14, 2014 · 0 comments
Open

DigestAuthenticator should implement IDisposable #28

highfield opened this issue May 14, 2014 · 0 comments

Comments

@highfield
Copy link

The DigestAuthenticator class in the HTTP project should implement IDisposable in order to dispose the NonceService (the inside Timer). As long the Timer is running a strong reference will keep the instance alive. In this way, new DigestAuthenticator instances will leak memory.
I'd also consider to expose the IDisposable interface to the HttpService, for the dispose chain.
Because the not-so-comfortable disposal of instances, another solution might be to have a centralized clock source (i.e. singleton), then turn any NonceService as a weak-observer of this source.

The example as in may lead to memory leaks:
https://github.com/jgauffin/griffin.networking/blob/master/Source/Protocols/Http/Griffin.Networking.Protocol.Http.DemoServer/Basic/MyHttpService.cs

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

1 participant