screenshot plugin: fix okhttp resource leak on imgur upload
This commit is contained in:
@@ -422,7 +422,8 @@ public class ScreenshotPlugin extends Plugin
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException
|
||||
{
|
||||
InputStream in = response.body().byteStream();
|
||||
try (InputStream in = response.body().byteStream())
|
||||
{
|
||||
ImageUploadResponse imageUploadResponse = RuneLiteAPI.GSON
|
||||
.fromJson(new InputStreamReader(in), ImageUploadResponse.class);
|
||||
|
||||
@@ -440,6 +441,7 @@ public class ScreenshotPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user