From: Nikolay Sivov Subject: Re: [PATCH 1/6] mf/samplegrabber: Always release cancellation key when timer is invoked. Message-Id: <8ca6bc06-6a6c-b76d-5eb2-fa36028d766f@codeweavers.com> Date: Wed, 5 Jan 2022 21:38:36 +0300 In-Reply-To: <48175fa4-6d01-7d1a-0d17-54c4ec780e8d@codeweavers.com> References: <20220104173527.77306-1-dlesho@codeweavers.com> <48175fa4-6d01-7d1a-0d17-54c4ec780e8d@codeweavers.com> On 1/5/22 18:52, Derek Lesho wrote: > On 1/5/22 06:01, Nikolay Sivov wrote: > >> >> >> On 1/4/22 20:35, Derek Lesho wrote: >>> The sample grabber currently leaks the key on the last invokation of >>> the timer, as it is only released when stream_schedule_sample is >>> called. >> It's also released when sample grabber sink is released. Is that not >> always enough? Or is that useful when sink is reused for next topology? >> >> > The problem is that it introduces a circular dependency, the cancel > key holds a reference to the timer callback, which contributes to the > reference count of the sample grabber stream sink and media sink. I see, so this could be solved by releasing this key on shutdown, and ensuring that shutdown actually happens. I'll take a look at what's going on with its special IMFActivate vs normal shutdown method.