Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5ebc792 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Avoid leaking AssetFileDescriptor.

Change-Id: Iac388c8aefc684980cb4c7131fb47319f6073eb3
parent 2df8e103
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -95,8 +95,16 @@ final class BinaryDictionaryGetter {
                    + fallbackResId);
            return null;
        }
        try {
            return AssetFileAddress.makeFromFileNameAndOffset(
                    context.getApplicationInfo().sourceDir, afd.getStartOffset(), afd.getLength());
        } finally {
            try {
                afd.close();
            } catch (IOException e) {
                // Ignored
            }
        }
    }

    private static final class DictPackSettings {