解决okhttp内存泄漏问题

This commit is contained in:
imhao183
2019-11-30 14:25:41 +08:00
parent 32f7266a5f
commit 6883418e22
@@ -53,6 +53,13 @@ public class HttpUtils {
@Override
public void onResponse(Call call, Response response) throws IOException {
LOG.info("POST to {} success with response: {}", url, response.body());
try {
if (response.body() != null) {
response.body().close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}