diff options
Diffstat (limited to 'src/org/openintents/openpgp/util')
-rw-r--r-- | src/org/openintents/openpgp/util/OpenPgpApi.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/org/openintents/openpgp/util/OpenPgpApi.java b/src/org/openintents/openpgp/util/OpenPgpApi.java index 9f51851..dbfb797 100644 --- a/src/org/openintents/openpgp/util/OpenPgpApi.java +++ b/src/org/openintents/openpgp/util/OpenPgpApi.java @@ -291,6 +291,14 @@ public class OpenPgpApi { } } + /** + * InputStream and OutputStreams are always closed after operating on them! + * + * @param data + * @param is + * @param os + * @return + */ public Intent executeApi(Intent data, InputStream is, OutputStream os) { ParcelFileDescriptor input = null; ParcelFileDescriptor output = null; @@ -349,7 +357,13 @@ public class OpenPgpApi { Log.e(OpenPgpApi.TAG, "IOException when closing ParcelFileDescriptor!", e); } } - // TODO: close input? Maybe the client wants to still use the input stream + if (input != null) { + try { + input.close(); + } catch (IOException e) { + Log.e(OpenPgpApi.TAG, "IOException when closing ParcelFileDescriptor!", e); + } + } } } |