konradrenner / kolabnotes-android

Note taking app with integrated Kolab sync
GNU Lesser General Public License v3.0
68 stars 17 forks source link

Fix native file descriptor being closed while still exporting. #210

Closed rdoeffinger closed 4 years ago

rdoeffinger commented 4 years ago

When the ParcelFileDescriptor gets garbage collected that will close the associated file descriptor. Since the exporting happens async in a different block, we can end up trying to write to a closed file descriptor. To fix this, just pass the ParcelFileDescriptor to the object doing the async export, so it will be destroyed only after we have closed the stream we write to. Fixes issue #188.

konradrenner commented 4 years ago

Thank you very much!