Skip to content

obs-properties: run destroy callbacks like the C (#1943) - #1949

Merged
zackees merged 2 commits into
masterfrom
fix/1943-properties-destroy
Oct 23, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/1943-properties-destroy

Conversation

@zackees

@zackees zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member

Fixes #1943.

Cause: obs_properties_destroy collected every destroy callback in the tree up front (props::destroy_list) and ran them afterwards, and obs_properties_remove_by_name dropped the removed property before running its group's callbacks. The C runs the set's own destroy first, then takes each property off the set (HASH_ITER/HASH_DEL) and destroys it, so a callback that changes the tree sees the C's result, and a removed group stays alive while its content's destroy runs.

RED (38917c9, three deterministic cases in rust/obs-properties/tests/properties/lifecycle.rs, run on the unchanged C oracle and on the Rust ABI; the oracle side passes):

  • parent destroy removes group g: Rust ["parent", "child", "child"] (child destroyed twice), C ["parent", "child"];
  • parent destroy adds group h: Rust ["parent", "child"] (new group never destroyed), C ["parent", "child", "added"];
  • removing g whose content destroy reads its own inner property: Rust SIGSEGV (use after free), C sees it.

GREEN (2b00c62): props::destroy / props::remove_by_name take the callback runner and call it with no RefCell borrow held: own param first, then each property popped off in order, a group's content destroyed while the group is held. All 16 properties:: tests in obs-tests-core pass, including the random Tier 3 parity sequences; lint passes.

Tiers: Tier 1/Tier 3 (the new cases compare against the oracle). No C test or public header changed. features.md line added next to #1939's.

@zackees
zackees added this pull request to the merge queue Oct 23, 2026
Merged via the queue into master with commit 0187f80 Oct 23, 2026
31 checks passed
@zackees
zackees deleted the fix/1943-properties-destroy branch October 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: obs-properties: parent callbacks can destroy child groups twice

1 participant