mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1251213 - release resources from fis. r=sebastian
MozReview-Commit-ID: 9RTJprP6rh2
This commit is contained in:
parent
a1c2a24964
commit
e234d8fd64
@ -2853,19 +2853,19 @@ private void CancelNotification()
|
||||
String sPort = "";
|
||||
int nEnd = 0;
|
||||
int nStart = 0;
|
||||
FileInputStream fis = null;
|
||||
|
||||
if ((sFileName == null) || (sFileName.length() == 0))
|
||||
return(sRet);
|
||||
|
||||
Context ctx = contextWrapper.getApplicationContext();
|
||||
try {
|
||||
FileInputStream fis = ctx.openFileInput(sFileName);
|
||||
fis = ctx.openFileInput(sFileName);
|
||||
int nBytes = fis.available();
|
||||
if (nBytes > 0)
|
||||
{
|
||||
byte [] buffer = new byte [nBytes + 1];
|
||||
int nRead = fis.read(buffer, 0, nBytes);
|
||||
fis.close();
|
||||
ctx.deleteFile(sFileName);
|
||||
if (nRead > 0)
|
||||
{
|
||||
@ -2898,6 +2898,19 @@ private void CancelNotification()
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (fis != null)
|
||||
{
|
||||
try {
|
||||
fis.close();
|
||||
}
|
||||
catch(IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return(sRet);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user