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

Close response body #4

Closed
eliasbellido opened this issue Jan 19, 2020 · 2 comments
Closed

Close response body #4

eliasbellido opened this issue Jan 19, 2020 · 2 comments

Comments

@eliasbellido
Copy link

Hi, I was reading the console log and found that whenever there's a bad response the following message shows up:

A connection to https://image.tmdb.org/ was leaked. Did you forget to close a response body?

Any workaround for that? I was digging a little and the solution is to close the body response on finally try catch on the ApiResponse.kt but I cannot get it to work.

Thanks in advance.

@skydoves
Copy link
Owner

skydoves commented Jan 19, 2020

@eliasbellido
Hi, it seems to happen the close() or string() method is not called when failed requests.
I pushed a commit related to close() related to the failed requests.
Could you check the warning still happened?

@eliasbellido
Copy link
Author

Yep it seems it's working just fine. Thanks man, I really appreciate your time and your code looks very nice (:
감사합니다!

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