On 5/4/20 10:56 PM, Derek Lesho wrote:
--- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -4014,6 +4014,7 @@ static HRESULT present_clock_schedule_timer(struct presentation_clock *clock, DW
if (FAILED(hr = MFCreateAsyncResult(&timer->IUnknown_iface, &clock->timer_callback, NULL, &result))) return hr;
IUnknown_Release(&timer->IUnknown_iface);
hr = MFScheduleWorkItemEx(result, -time, &timer->key); IMFAsyncResult_Release(result);
This is a wrong place to release it. Creating result object grabs a timer reference, scheduling it grabs result object reference, and original reference is released.
Timer object is created with refcount of 1, additional reference is taken by result object, another one by cancellation object, optionally. It's released on timer callback, on cancel request, or on clock release. The only path it's leaked I think is on error in present_clock_timer_SetTimer(). Does the attached patch work?