On Mon Jan 12 20:22:34 2026 +0000, Yuxuan Shui wrote:
So what happens is: 1. we get to asf_reader_destroy, and the WMReader is still running. 2. since WMReader is still running, it may invoke `IWMReaderCallback::OnStatus`, which is `reader_callback_OnStatus`. 3. we release the `IWMReaderCallback` object before the WMReader. 4. WMReader calls `reader_callback_OnStatus` and segfaults. In this specific test case, the asf reader is release very quickly, the background read thread hasn't completed its first `GetNextSample`. That `GetNextSample` call returns NO_MORE_SAMPLES because no streams were enabled in this test. The read thread got NO_MORE_SAMPLES and thus invokes the `OnStatus` callback which is how we got to step (4). This MR makes sure the WMReader is released first, which means read thread is stopped and no more callbacks can happen. Right okay, I forgot we rely on Release() to tear down everything if the filter is still running.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9871#note_128066