Repository navigation
fix(canvas): release a source's weak canvas ref after the canvas is gone - #2041
Conversation
…urces left in it (#2038) The test now expects only the two leftover sources' control blocks after shutdown: obs_free_data() leaves those by design.
|
Pushed f8af0de. With the full ASan stacks from #2036, the 5 leaked allocations are: the canvas control block (fixed by 7e932c9), the canvas's source-name hash table and its bucket array ( |
|
@zackees master regression, probably from this PR: It first fails on master at 08aed4e (this PR). Since then it failed in master runs 40060359610 and 40060836905 and in the merge groups for #2046 (40065324798) and #2054, while other runs pass. The test creates and releases sources on canvases, which is the weak-canvas-ref path changed here. It is ejecting unrelated PRs from the queue. |
Fixes #2038
obs_free_data()releases the main canvas before it destroys the sources the host left alive.obs_canvas_remove_source()releasedsource->canvasonly while the canvas was still alive, so each leftover source leaked its weak ref, and the canvas control block leaked with it (ASan: obs-canvas.c.h:330 and :158 in test_context_names and test_shutdown_type_lifetime).test_shutdown_canvas_weak_ref(Tier 2, public API) checksbnum_allocs()after shutting down with a source and a scene left alive. Local./unittestfails with5 != 0at line 68, and every other test in that run passes (411/412).obs_weak_canvas_get_canvasstill returns the canvas.obs_weak_canvas_releaseis safe on NULL../lintpasses; PR CI runs Tier 2 against both libobs builds.Tiers 1 and 3 don't apply: obs-canvas has no Rust port yet.