[incfs] Fix a leaked pending_reads FD am: 4e21986e59 am: 3efaf9879f
Change-Id: I0638336bd73fea89ea184260fb64b97a78935c76
This commit is contained in:
@@ -34,6 +34,8 @@ import android.os.ParcelFileDescriptor;
|
||||
import android.util.ExceptionUtils;
|
||||
import android.util.Slog;
|
||||
|
||||
import libcore.io.IoUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -115,22 +117,10 @@ public abstract class DataLoaderService extends Service {
|
||||
destroy(id);
|
||||
throw new RuntimeException(ex);
|
||||
} finally {
|
||||
// Closing FDs.
|
||||
if (control.incremental != null) {
|
||||
if (control.incremental.cmd != null) {
|
||||
try {
|
||||
control.incremental.cmd.close();
|
||||
} catch (IOException e) {
|
||||
Slog.e(TAG, "Failed to close IncFs CMD file descriptor " + e);
|
||||
}
|
||||
}
|
||||
if (control.incremental.log != null) {
|
||||
try {
|
||||
control.incremental.log.close();
|
||||
} catch (IOException e) {
|
||||
Slog.e(TAG, "Failed to close IncFs LOG file descriptor " + e);
|
||||
}
|
||||
}
|
||||
IoUtils.closeQuietly(control.incremental.cmd);
|
||||
IoUtils.closeQuietly(control.incremental.pendingReads);
|
||||
IoUtils.closeQuietly(control.incremental.log);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user