Skip to content

Commit e10ef0f

Browse files
fix: clarify memory management in FFI progress handling
This commit updates the comment regarding the handling of ffi_progress in the FFI layer. It clarifies that ffi_progress will be dropped normally, as there is no Drop implementation, improving the understanding of memory management in the context of progress callbacks.
1 parent 2aa843e commit e10ef0f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

dash-spv-ffi/src/client.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,7 @@ pub unsafe extern "C" fn dash_spv_ffi_client_sync_to_tip_with_progress(
846846
);
847847
// Destroy stage_message allocated in FFIDetailedSyncProgress::from
848848
crate::types::dash_spv_ffi_string_destroy(stage_message);
849-
// Prevent Drop from running on the struct to avoid re-freeing
850-
std::mem::forget(ffi_progress);
849+
// ffi_progress will be dropped normally here; no Drop impl exists
851850
}
852851
}
853852
}

0 commit comments

Comments
 (0)