Repository navigation
test: Free the background hotkey state in test_portal_shortcuts - #465
Merged
Merged
Conversation
The test runs the portal code against its own obs_core and tore it down with obs_hotkeys_free() only. The background shortcuts, their trigger strings and the error string are freed by obs_free_hotkeys() in obs.c, which the test doesn't build, so LeakSanitizer and valgrind reported them as leaks. The teardown now frees them the same way. OBS itself doesn't leak here. Closes #464 Local-Gate: v1 tree=01d301cb202c536c05372d2a4238d210af483776 secs=259 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791871748,"gate":"rust/all/fmt","host":"linux-x86_64","key":"558664c5766ec795d0017c4acdd11ff4b9d5d700dbe93c18089a28dd6abc5ef3","lane":"lint","parents":["1c3961ae138b65e4690a1b9396f713f68db9e7cc"],"secs":31,"stamp":"22ea443ee33f75e9c03b840abdb44170","tree":"01d301cb202c536c05372d2a4238d210af483776","v":1,"via":"run"} Ci-Attestation: {"at":1791871748,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"558664c5766ec795d0017c4acdd11ff4b9d5d700dbe93c18089a28dd6abc5ef3","lane":"lint","parents":["1c3961ae138b65e4690a1b9396f713f68db9e7cc"],"secs":31,"stamp":"0b0a088382041ca07a701708a6ee16d6","tree":"01d301cb202c536c05372d2a4238d210af483776","v":1,"via":"run"} Ci-Attestation: {"at":1791871748,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"51cbacbd95cdb02e3d6e835517bc820ed41ac874d30ab14dc5e657516b067b91","lane":"rust-test","parents":["1c3961ae138b65e4690a1b9396f713f68db9e7cc"],"secs":135,"stamp":"941349dc19efcd11c71981d425044eba","tree":"01d301cb202c536c05372d2a4238d210af483776","v":1,"via":"run"} Ci-Attestation: {"at":1791871748,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"169437838bf117b757c0040ead323eb1a8ba15fefce1b482eae116610b101d1b","lane":"tier2-linux","parents":["1c3961ae138b65e4690a1b9396f713f68db9e7cc"],"secs":93,"stamp":"0f556fe25b93db7edfbaf62e7f10e60b","tree":"01d301cb202c536c05372d2a4238d210af483776","v":1,"via":"run"}
Member
Author
|
ASan pass on this branch (run 38355130077): |
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #464.
LeakSanitizer and valgrind reported 2496 bytes in 46 allocations from
test_portal_shortcuts: the background shortcuts darray (set_shortcuts), each shortcut's trigger string (set_triggers), and the error string (set_state). OBS doesn't leak here.obs_free_hotkeys()inobs.cfrees all three at shutdown. The test runs the portal code against its ownobs_core(-Dobs=hotkey_test_obs), doesn't buildobs.c, and tore down withobs_hotkeys_free()only.The teardown now does the same
obs_hotkeys_background_clear_shortcuts+da_free+bfree(error).Verification:
--repeat 3passes OFF/ON (147/147).test_portal_shortcuts.