Repository navigation
frontend: Remove the mixer and stats event callbacks only once - #425
Merged
Merged
Conversation
AudioMixer and OBSBasicStats remove their frontend event callback on OBS_FRONTEND_EVENT_EXIT. After that the frontend API is torn down, and ~AudioMixer (and a stats closeEvent during teardown) removed it again, logging "Tried to call obs_frontend_remove_event_callback with no callbacks!" on every shutdown. Each now tracks whether its callback is still registered. Closes #156 Local-Gate: v1 tree=75ee54f1cc693d8a76dcf57818d445b665f9d974 secs=136 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791855255,"gate":"rust/all/fmt","host":"linux-x86_64","key":"d5ef385dec9b77f245096268caa8cf3ba003a35ea9b8510b53a8b1e827f3c664","lane":"lint","parents":["487c90c44ffb91e59baa6dd5304688309f8ac2d4"],"secs":18,"stamp":"4c952c88ed49a589f1623139e1ac9bf0","tree":"75ee54f1cc693d8a76dcf57818d445b665f9d974","v":1,"via":"run"} Ci-Attestation: {"at":1791855255,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"d5ef385dec9b77f245096268caa8cf3ba003a35ea9b8510b53a8b1e827f3c664","lane":"lint","parents":["487c90c44ffb91e59baa6dd5304688309f8ac2d4"],"secs":18,"stamp":"5866864ddb3102c4b8d46907acdd9454","tree":"75ee54f1cc693d8a76dcf57818d445b665f9d974","v":1,"via":"run"} Ci-Attestation: {"at":1791855255,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"2c91e1e6f4f042c13e72f986474cd72635e1b9083b364557404f15c285c34f16","lane":"rust-test","parents":["487c90c44ffb91e59baa6dd5304688309f8ac2d4"],"secs":50,"stamp":"2057a90f5d285518b3ea23a01edc5ffd","tree":"75ee54f1cc693d8a76dcf57818d445b665f9d974","v":1,"via":"run"} Ci-Attestation: {"at":1791855255,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"0cbc7907366e3c5c4e6f5f8895cd586d2f69301fc889e5f32388cf71b67ebca2","lane":"tier2-linux","parents":["487c90c44ffb91e59baa6dd5304688309f8ac2d4"],"secs":68,"stamp":"39b850dcf8e440d1243ec9d80a8f16e4","tree":"75ee54f1cc693d8a76dcf57818d445b665f9d974","v":1,"via":"run"}
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 #156.
Every normal shutdown logged
Tried to call obs_frontend_remove_event_callback with no callbacks!.OBSBasic::closeWindowsendsOBS_FRONTEND_EVENT_EXITand then tears down the frontend API.AudioMixerremoves its callback on EXIT, then~AudioMixerremoved it again unconditionally, after the API was gone.OBSBasicStatshas the same shape (EXIT, thencloseEvent).Fix: each widget sets
frontendEventCallbackAddedwhen it registers and removes throughremoveFrontendEventCallback(), which does nothing once removed. The EXIT path and the later destructor orcloseEventpath therefore remove it exactly once.No RED test: these are Qt widgets torn down inside
OBSBasic::closeWindow, and there is no Qt-free seam to unit test without a much larger refactor. Verification is this PR's full OBS builds (Linux, macOS, Windows, Flatpak) plus checking a launch/quit log for the message. The local gate (lint, Rust, Tier 2) passed and is stamped, but it doesn't compile the frontend.