Skip to content

frontend: Free the shortcut and native event filters - #492

Merged
zackees merged 1 commit into
masterfrom
fix/frontend-event-filter-leaks
Oct 13, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/frontend-event-filter-leaks

Conversation

@zackees

@zackees zackees commented Oct 13, 2026

Copy link
Copy Markdown
Member

Part of #449. These are the OBS-owned leaks in the first clean-exit LeakSanitizer report: sanitizers run 38360696761 on #473, where OBS now gets SIGINT itself and exits 0. 632 bytes in 9 allocations; the rest is fontconfig/expat.

  • CreateShortcutFilter() → new OBSEventFilter with no parent, passed to installEventFilter at nine sites (AutoConfig, OBSProjector, NameDialog, OBSRemux, OBSBasicFilters, LogUploadDialog, OBSBasicProperties, and others). One filter leaks every time one of those dialogs or wizards opens. It now takes the owning parent (CreateShortcutFilter(this)), and the default stays nullptr for callers that already own it (SettingsEventFilter's QScopedPointer, OBSBasic/OBSBasicStats members).
  • OBSApp::OBSApp: installNativeEventFilter(new OBS::NativeEventFilter) is never freed. It's now a std::unique_ptr member, removed in ~OBSApp before it's freed (QCoreApplication's destructor runs after ours).

Upstream frontend code. The local gate passed and is stamped, but it doesn't compile the frontend, so this PR's Ubuntu OBS build is the compile check. I'll re-run the ASan pass after merge to confirm the report only shows library frames.

LeakSanitizer's first clean-exit report (#449) showed two frontend
leaks: the OBSEventFilter from CreateShortcutFilter, which nine widgets
and dialogs install with no parent (one per AutoConfig wizard, per
properties or filters dialog...), and OBSApp's NativeEventFilter.
CreateShortcutFilter now takes the parent that owns the filter, and
OBSApp owns its native filter and removes it before freeing it.

Refs #449

Local-Gate: v1 tree=260545f90129e86ff79f4a278836713ef2088a0a secs=410 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791876774,"gate":"rust/all/fmt","host":"linux-x86_64","key":"2824252d0234a53b7855a25268d8b4b273cb28bd6d4f16995d1b52c825b47325","lane":"lint","parents":["1a096bf437240c9c3690ec06935e2022ed436221"],"secs":50,"stamp":"63a300393ed8ad22729f20f35381f27c","tree":"260545f90129e86ff79f4a278836713ef2088a0a","v":1,"via":"run"}
Ci-Attestation: {"at":1791876774,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"2824252d0234a53b7855a25268d8b4b273cb28bd6d4f16995d1b52c825b47325","lane":"lint","parents":["1a096bf437240c9c3690ec06935e2022ed436221"],"secs":50,"stamp":"423400377fb8336f9c065bd5c78e57d6","tree":"260545f90129e86ff79f4a278836713ef2088a0a","v":1,"via":"run"}
Ci-Attestation: {"at":1791876774,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"c4273c3e855c237ef15290549d23d542b5412dd0bb8c4cf00a6adfb2f2998bee","lane":"rust-test","parents":["1a096bf437240c9c3690ec06935e2022ed436221"],"secs":289,"stamp":"ddfe4a296d1d93a953c836285641224a","tree":"260545f90129e86ff79f4a278836713ef2088a0a","v":1,"via":"run"}
Ci-Attestation: {"at":1791876774,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"bc3522bd57ea44f16adcddf00698a0c7e5c498c9ee525ebee475b237c9404a95","lane":"tier2-linux","parents":["1a096bf437240c9c3690ec06935e2022ed436221"],"secs":70,"stamp":"e7053aa96ef8d944ce4ad1d91fabc33f","tree":"260545f90129e86ff79f4a278836713ef2088a0a","v":1,"via":"run"}
@zackees
zackees merged commit 7f90fe3 into master Oct 13, 2026
18 checks passed
zackees added a commit that referenced this pull request Oct 13, 2026
* ci: Check that obs-websocket keeps the bounded parser (RED)

#492 moved plugins/obs-websocket back to upstream 073a294 and undid
the #99 fix without anything failing.

* obs-websocket: Restore the bounded websocket parser

#492 moved plugins/obs-websocket from 7d89109c9 back to 073a294
(upstream), apparently from a stale submodule checkout, undoing
8d06e60 (#99). Point it at the project fork's bounded parser again.

Local-Gate: v1 tree=d87ddc88f4e827d7d4b9c67559d6d6c01f74365b secs=317 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791878069,"gate":"rust/all/fmt","host":"linux-x86_64","key":"2e31e0b2a932183bd3d2e4471d9a2c1dde9d3a3029e694403e8005d12a98da24","lane":"lint","parents":["bd7b9e7d09297db5899ebea5aef209da9c37633e"],"secs":107,"stamp":"117c854883a977a6b8d3fe1a7c5bde60","tree":"d87ddc88f4e827d7d4b9c67559d6d6c01f74365b","v":1,"via":"run"}
Ci-Attestation: {"at":1791878069,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"2e31e0b2a932183bd3d2e4471d9a2c1dde9d3a3029e694403e8005d12a98da24","lane":"lint","parents":["bd7b9e7d09297db5899ebea5aef209da9c37633e"],"secs":107,"stamp":"fac6548a4634f8f0b162ea683a673dea","tree":"d87ddc88f4e827d7d4b9c67559d6d6c01f74365b","v":1,"via":"run"}
Ci-Attestation: {"at":1791878069,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"de250fabb6bfb60dd98490a79c370de3524824d4fd73e167e795e1f9d64d696a","lane":"rust-test","parents":["bd7b9e7d09297db5899ebea5aef209da9c37633e"],"secs":129,"stamp":"eaef4829461680df499a969fdbdc16f9","tree":"d87ddc88f4e827d7d4b9c67559d6d6c01f74365b","v":1,"via":"run"}
Ci-Attestation: {"at":1791878069,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"136614939b09567f7f5ae3dd50eb54470c932a1e967847b1e40ddf2d16d1a7aa","lane":"tier2-linux","parents":["bd7b9e7d09297db5899ebea5aef209da9c37633e"],"secs":80,"stamp":"8ba16a991ae8204fcf31cd66d6f02b03","tree":"d87ddc88f4e827d7d4b9c67559d6d6c01f74365b","v":1,"via":"run"}
zackees added a commit that referenced this pull request Oct 13, 2026
#496 moved plugins/obs-websocket back to upstream 073a294, like #492
did, undoing the #99 fix a second time. ci/test_websocket_submodule.py
skips when the submodule is not checked out, so it did not stop it.
zackees added a commit to rdoupe/obs-studio that referenced this pull request Oct 13, 2026
572c7ea (obs-rust#496) committed a stale local checkout of the submodule and
moved it back to upstream 073a294, undoing obs-rust#99's bounded websocket
parser a second time (after obs-rust#492). test_websocket_submodule.py catches
it; this restores 7d89109c9.

Refs obs-rust#99

Local-Gate: v1 tree=b5bfff21305a582bb16888995901b112545028ee secs=343 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791879241,"gate":"rust/all/fmt","host":"linux-x86_64","key":"c22783d5ad2c080129ba564fe592f1f28873cb3796602ce8c42c6ce6cee6fec6","lane":"lint","parents":["9e1bd8bc9ded9548df1a6db8172698a76485508a"],"secs":37,"stamp":"e1cb98357ddea204061cd748d04465f7","tree":"b5bfff21305a582bb16888995901b112545028ee","v":1,"via":"run"}
Ci-Attestation: {"at":1791879241,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"c22783d5ad2c080129ba564fe592f1f28873cb3796602ce8c42c6ce6cee6fec6","lane":"lint","parents":["9e1bd8bc9ded9548df1a6db8172698a76485508a"],"secs":37,"stamp":"b2c82732b02449a9c51084f62773d26c","tree":"b5bfff21305a582bb16888995901b112545028ee","v":1,"via":"run"}
Ci-Attestation: {"at":1791879241,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"c6e438ad4e574fddc2789df4af9114b667f07a3fce578cf36d2d463c5bc12b4f","lane":"rust-test","parents":["9e1bd8bc9ded9548df1a6db8172698a76485508a"],"secs":220,"stamp":"c7ec11776caaae1398fbce38510a7a87","tree":"b5bfff21305a582bb16888995901b112545028ee","v":1,"via":"run"}
Ci-Attestation: {"at":1791879241,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"481a4aa3ad5a78fbd86d5f2bfc2b16c8474be5c8316827cb934c87961be12258","lane":"tier2-linux","parents":["9e1bd8bc9ded9548df1a6db8172698a76485508a"],"secs":85,"stamp":"7f12437bc9c0f6438d4c66b9a5258326","tree":"b5bfff21305a582bb16888995901b112545028ee","v":1,"via":"run"}
zackees added a commit that referenced this pull request Oct 13, 2026
…618)

* ci: Name the known-bad upstream obs-websocket pointer in the guard

The ancestry check misreports a good pointer as missing the bounded
parser when the submodule checkout is shallow (RED: a4040cb72 fails on a
shallow clone). Check the pointer #492 and #496 committed by value first.

* ci: Skip the obs-websocket ancestry check on a shallow checkout (GREEN)

A shallow submodule fetch can stop above the bounded-parser commit, so
merge-base --is-ancestor fails for a good pointer. Skip in that case;
the known-bad pointer is still caught by value.

Local-Gate: v1 tree=3f264f71e0b54e390a7e3f34b7c8ae0ec5bee7e2 secs=371 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1791923215,"gate":"rust/all/fmt","host":"linux-x86_64","key":"dc3590a6cc224d71886c483fbb4f10e785cb5251a483b37a2cdbeb4c0b87aaaa","lane":"lint","parents":["56fefc13ff8cd65f81f6bb349ac2a8ac90cdb819"],"secs":28,"stamp":"4dd9d3d4c0c988abe3e4f7ed6f16e8bc","tree":"3f264f71e0b54e390a7e3f34b7c8ae0ec5bee7e2","v":1,"via":"run"}
Ci-Attestation: {"at":1791923215,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"dc3590a6cc224d71886c483fbb4f10e785cb5251a483b37a2cdbeb4c0b87aaaa","lane":"lint","parents":["56fefc13ff8cd65f81f6bb349ac2a8ac90cdb819"],"secs":28,"stamp":"2c9b328e999b0627a1057e0e63a04b9f","tree":"3f264f71e0b54e390a7e3f34b7c8ae0ec5bee7e2","v":1,"via":"run"}
Ci-Attestation: {"at":1791923215,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"924edf4510566dbf8ed3c3c6ae2d44ce7d3f71801a069437ced737bd44934c62","lane":"rust-test","parents":["56fefc13ff8cd65f81f6bb349ac2a8ac90cdb819"],"secs":116,"stamp":"d611450e51a52e720febc237002f66c5","tree":"3f264f71e0b54e390a7e3f34b7c8ae0ec5bee7e2","v":1,"via":"run"}
Ci-Attestation: {"at":1791923215,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"4d5bce6c57cbf669ebd2e6062d4b023fdea168909ffe386e28ea038b9f47d1a6","lane":"cross","parents":["56fefc13ff8cd65f81f6bb349ac2a8ac90cdb819"],"secs":95,"stamp":"0da0cc2db5dc8923d97b44d9cc673669","tree":"3f264f71e0b54e390a7e3f34b7c8ae0ec5bee7e2","v":1,"via":"run"}
Ci-Attestation: {"at":1791923215,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"4d5bce6c57cbf669ebd2e6062d4b023fdea168909ffe386e28ea038b9f47d1a6","lane":"cross","parents":["56fefc13ff8cd65f81f6bb349ac2a8ac90cdb819"],"secs":95,"stamp":"534610d5f1597fb9032a1504a2757e6d","tree":"3f264f71e0b54e390a7e3f34b7c8ae0ec5bee7e2","v":1,"via":"run"}
Ci-Attestation: {"at":1791923215,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"4d5bce6c57cbf669ebd2e6062d4b023fdea168909ffe386e28ea038b9f47d1a6","lane":"cross","parents":["56fefc13ff8cd65f81f6bb349ac2a8ac90cdb819"],"secs":95,"stamp":"ee7591f1b839e644b2a66d57eac32985","tree":"3f264f71e0b54e390a7e3f34b7c8ae0ec5bee7e2","v":1,"via":"run"}
Ci-Attestation: {"at":1791923215,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"4d5bce6c57cbf669ebd2e6062d4b023fdea168909ffe386e28ea038b9f47d1a6","lane":"cross","parents":["56fefc13ff8cd65f81f6bb349ac2a8ac90cdb819"],"secs":95,"stamp":"62b8dd76fd9bbff05eb07f63f7c385e9","tree":"3f264f71e0b54e390a7e3f34b7c8ae0ec5bee7e2","v":1,"via":"run"}
Ci-Attestation: {"at":1791923215,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"4d5bce6c57cbf669ebd2e6062d4b023fdea168909ffe386e28ea038b9f47d1a6","lane":"cross","parents":["56fefc13ff8cd65f81f6bb349ac2a8ac90cdb819"],"secs":95,"stamp":"b9a9c3a621ee27d1735100b407101930","tree":"3f264f71e0b54e390a7e3f34b7c8ae0ec5bee7e2","v":1,"via":"run"}
Ci-Attestation: {"at":1791923215,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"4d5bce6c57cbf669ebd2e6062d4b023fdea168909ffe386e28ea038b9f47d1a6","lane":"cross","parents":["56fefc13ff8cd65f81f6bb349ac2a8ac90cdb819"],"secs":95,"stamp":"28ca9ecfa2446bd0d00140ad10253e02","tree":"3f264f71e0b54e390a7e3f34b7c8ae0ec5bee7e2","v":1,"via":"run"}
Ci-Attestation: {"at":1791923215,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"71293b64cb990c5656784f4a19e7f57d4791d89942bb4c5249bacd0de82a7b5b","lane":"tier2-linux","parents":["56fefc13ff8cd65f81f6bb349ac2a8ac90cdb819"],"secs":131,"stamp":"ab7550f124d4788e0c47afb72d48f6f5","tree":"3f264f71e0b54e390a7e3f34b7c8ae0ec5bee7e2","v":1,"via":"run"}
@zackees
zackees deleted the fix/frontend-event-filter-leaks branch October 26, 2026 15:44
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.

1 participant