ticketmaster-api / sdk-java

Ticketmaster Java SDK
http://developer.ticketmaster.com/
MIT License
19 stars 24 forks source link

Make sure okhttp3.ResponseBody is always closed. #26

Closed gdriban closed 6 years ago

gdriban commented 6 years ago

When Discovery Response.getContent() is not called ( e.g. - when unsuccessful Http status ), the okhttp3.ResponseBody will not get closed. Change semantics of Response so that the okhttp3.ResponseBody is always closed. Otherwise, there is a memory leak. Could have made this change in many ways. Would have preferred to entirely remove containment of okhttp3.Response in the Discovery Response type, but took path of fewest changes.

plthibeault commented 6 years ago

@ledor473 Can you give me write to the repo so I can merge this please