Closed
Description
I'm using the published 3.0.0-RC1.
I'm seeing this message:
WARNING: A connection to https://api.push.apple.com/ was leaked. Did you forget to close a response body?
Jan 08, 2016 8:23:58 PM okhttp3.ConnectionPool pruneAndGetAllocationCount
Over and over.
My code looks like this:
client.newCall(request).enqueue(new Callback() {
override def onFailure(request: Request, throwable: IOException) {
}
override def onResponse(response: Response) {
if (!response.isSuccessful()) {
val body = response.body()
val charStream = body.charStream()
val reason = GSON.fromJson(charStream, classOf[APNSError])
body.close()
}
}
})
(Note that the example Gson recipe leaks the body there, but this doesn't.)
Do I need to close the body in the successful case even if I'm not reading it?
Thanks!
Activity