mirror of
https://github.com/tonhowtf/omniget.git
synced 2026-10-02 09:54:49 +08:00
Opening the share picker twice crashed the app with an access violation. The capture paths wrapped each call in CoInitializeEx/CoUninitialize, but tearing the apartment down does not invalidate the WinRT activation factories the windows crate caches, so the second GraphicsCaptureSession::IsSupported read freed memory. CoIncrementMTAUsage exists for this: an implicit MTA that outlives every call, with the cookie deliberately never released. The worker threads stop initialising their own apartments for the same reason. Found by the capture self-test on the Windows CI job, which is why it exists.