Skip to content

Fix memory leak in checkpoint drop - #15

Draft
evanlinjin wants to merge 1 commit into
masterfrom
codex/locate-and-fix-an-important-bug
Draft

Fix memory leak in checkpoint drop#15
evanlinjin wants to merge 1 commit into
masterfrom
codex/locate-and-fix-an-important-bug

Conversation

@evanlinjin

Copy link
Copy Markdown
Owner

Summary

  • avoid leaking memory when dropping CheckPoint linked lists
  • add unit test ensuring memory is released when checkpoints are dropped

Testing

  • cargo clippy -p bdk_core -- -D warnings
  • cargo test -p bdk_core -- --test-threads=1

https://chatgpt.com/codex/tasks/task_e_687b0cee4bec832db8c6c604e4100a6e

@evanlinjin
evanlinjin force-pushed the codex/locate-and-fix-an-important-bug branch from e4a9ab9 to f3b9dd3 Compare July 19, 2025 07:36
Fix memory leak bug in `CheckPoint::drop` by using `Arc::into_inner` if
it is available (>= 1.70).

Fix `CPInner::drop` logic so that if `CPInner::block` becomes
generic and is of a type that required `drop`, it does not leak memory.

Add tests for memory leak + stack overflow when dropping `CheckPoint`.
@evanlinjin
evanlinjin force-pushed the codex/locate-and-fix-an-important-bug branch from f3b9dd3 to bf417f9 Compare July 20, 2025 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant