You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So if you were to make the TwitchAPI disposable, you would presumable want to clean up the HttpClient it uses internally which would then cause memory issues.
What should be changed instead is that an IHttpClientFactory should be used to create an IHttpClient instance, that way each TwitchAPI would get the same instance of the HttpClient and it would be re-used without issue.
This is what I do in my own program, e.g. I explicitly create a TwitchHttpClient for the TwitchAPI and the HttpClient the TwitchHttpClient receives is the same one every time.
As noted in the title. The TwitchAPI creates a handler
http
, which should be disposed of for short lived TwitchAPI uses.The text was updated successfully, but these errors were encountered: