diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-01-09 16:32:30 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-01-09 16:48:53 +0100 |
commit | 29280b8898061858d7ff1910d8c004d6d1057019 (patch) | |
tree | 1b56dd5699dd1c027123ac459616365b3c1bfadf /ffi/src/openpgp/packet_pile.rs | |
parent | fd95fa4f42afa73d09a3d32e88acd083fef756d5 (diff) |
ffi: Use Option<&mut T> for destructors.
- This reflects the fact that destructors may be called with NULL.
Diffstat (limited to 'ffi/src/openpgp/packet_pile.rs')
-rw-r--r-- | ffi/src/openpgp/packet_pile.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ffi/src/openpgp/packet_pile.rs b/ffi/src/openpgp/packet_pile.rs index 33a3735f..5f624c36 100644 --- a/ffi/src/openpgp/packet_pile.rs +++ b/ffi/src/openpgp/packet_pile.rs @@ -73,7 +73,8 @@ pub extern "system" fn sq_packet_pile_from_bytes(ctx: *mut Context, /// Frees the packet_pile. #[no_mangle] -pub extern "system" fn sq_packet_pile_free(packet_pile: *mut PacketPile) { +pub extern "system" fn sq_packet_pile_free(packet_pile: Option<&mut PacketPile>) +{ ffi_free!(packet_pile) } |