diff options
| author | Mason Reed <mason@vector35.com> | 2025-06-16 14:45:12 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-07-02 01:56:53 -0400 |
| commit | 1e46970989da83dd50a052cc1d023c70d5ed127f (patch) | |
| tree | d7dca1f665a18702a3a301bfd37cdc5d2ae85168 /rust/src/binary_view.rs | |
| parent | b53423da93809d71389127c41739247917688f37 (diff) | |
[Rust] Add a comment about cleaning up the `BinaryView` object
Diffstat (limited to 'rust/src/binary_view.rs')
| -rw-r--r-- | rust/src/binary_view.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rust/src/binary_view.rs b/rust/src/binary_view.rs index 394dda16..417b30ef 100644 --- a/rust/src/binary_view.rs +++ b/rust/src/binary_view.rs @@ -1962,6 +1962,12 @@ pub trait BinaryViewExt: BinaryViewBase { impl<T: BinaryViewBase> BinaryViewExt for T {} +/// # Cleaning up +/// +/// [`BinaryView`] has a cyclic relationship with the associated [`FileMetadata`], each holds a strong +/// reference to one another, so to properly clean up/free the [`BinaryView`], you must manually close the +/// file using [`FileMetadata::close`], this is not fixable in the general case, until [`FileMetadata`] +/// has only a weak reference to the [`BinaryView`]. #[derive(PartialEq, Eq, Hash)] pub struct BinaryView { pub(crate) handle: *mut BNBinaryView, |
