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