Skip to content

frontend: Fallback warning: answer warnings after shutdown, and align the cb docs #2369

Closed

Description

@vpacher

Summary

Two follow-ups from the coordinator review of #2238 (#2238 (review)), the shared fallback warning (#2218). Both were non-blocking.

  1. A warning after shutdown is never answered. closeWindow() calls FallbackWarning::SetMainWindow(nullptr) and flushes the posted events. A Warn() that comes after that (for example from a source's destroy during shutdown) is queued to an event loop that no longer runs, so its cb is never called. A caller that frees param in cb leaks it. This breaks the "called once" contract of obs_frontend_warn_fallback().
  2. The docs disagree on "never inside the call". docs/fallback-warning.md says cb is called "never inside the call", but without the OBS frontend it is called inside the call (the API reference and frontend: Shared fallback warning with a countdown (obs_frontend_warn_fallback) #2238 say so).

Scope

  • frontend/utility/FallbackWarning: after SetMainWindow(nullptr), Warn() logs as before and then calls cb(param, true) at once, inside the call. A mutex that both take makes the order clear: a warning posted before shutdown is answered by the flush, a later one at once. SetMainWindow(window) starts the queue again.
  • docs/fallback-warning.md and docs/sphinx/reference-frontend-api.rst: cb is never called inside the call while OBS runs; without the OBS frontend and after shutdown, it is (with true).

Acceptance criteria

  • RED then GREEN: a case in test_fallback_warning_queue that warns after SetMainWindow(nullptr) gets exactly one answer, accepted=true, inside the call, with the log line. It passes with and without the frontend's Rust.
  • The existing queue, dialog and API tests still pass.
  • The policy doc and the API reference say the same thing about when cb runs.

Suggested: P3, size:S.

Metadata

Metadata

Assignees

Labels

readyMeets the definition of Ready; claimable

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions