On Mon Jan 12 20:22:34 2026 +0000, Elizabeth Figura wrote:
I still don't understand this explanation, I'm afraid. What are we trying to access that has been freed, and how do we know this is the right way to deal with it? 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. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9871#note_126659