OkHttp sources and sinks are not threadsafe, fix #369

This commit is contained in:
Emux 2017-07-03 12:18:49 +03:00
parent 8db30d8537
commit 2dbad2b16a

View File

@ -100,14 +100,8 @@ public class OkHttpEngine implements HttpEngine {
if (mInputStream == null) if (mInputStream == null)
return; return;
final InputStream is = mInputStream; IOUtils.closeQuietly(mInputStream);
mInputStream = null; mInputStream = null;
new Thread(new Runnable() {
@Override
public void run() {
IOUtils.closeQuietly(is);
}
}).start();
} }
@Override @Override