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.
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.