Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-Android
Commits
6cd6fa17
Commit
6cd6fa17
authored
Jul 18, 2014
by
Jean-Baptiste Kempf
Browse files
AudioService: do not leak resources in exceptions
And catch all exceptions
parent
f1069517
Changes
1
Hide whitespace changes
Inline
Side-by-side
vlc-android/src/org/videolan/vlc/audio/AudioService.java
View file @
6cd6fa17
...
...
@@ -1382,8 +1382,8 @@ public class AudioService extends Service {
return
;
String
line
;
FileInputStream
input
;
BufferedReader
br
;
FileInputStream
input
=
null
;
BufferedReader
br
=
null
;
int
rowCount
=
0
;
int
position
=
0
;
...
...
@@ -1396,7 +1396,7 @@ public class AudioService extends Service {
br
=
new
BufferedReader
(
new
InputStreamReader
(
input
));
currentMedia
=
br
.
readLine
();
mShuffling
=
"1"
.
equals
(
br
.
readLine
());
br
.
close
();
br
.
close
();
br
=
null
;
input
.
close
();
// read MediaList
...
...
@@ -1408,16 +1408,21 @@ public class AudioService extends Service {
position
=
rowCount
;
rowCount
++;
}
br
.
close
();
input
.
close
();
// load playlist
mInterface
.
load
(
mediaPathList
,
position
,
false
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
RemoteException
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
br
!=
null
)
br
.
close
();
if
(
input
!=
null
)
input
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
private
synchronized
void
saveCurrentMedia
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment