<div dir="ltr">Hi, Zebediah.<div>Thanks for the detailed research.<br>I've revert the first patch, applied the next one and the test was successful!</div><div>Is the code fix as intended? If it is ok, I will send a PATCH v2.<br><div><br></div><div>diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c<br>index 73a923a7b99..0eb339420db 100644<br>--- a/dlls/quartz/systemclock.c<br>+++ b/dlls/quartz/systemclock.c<br>@@ -338,6 +338,7 @@ HRESULT system_clock_create(IUnknown *outer, IUnknown **out)<br>     list_init(&object->sinks);<br>     InitializeCriticalSection(&object->cs);<br>     object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SystemClockImpl.cs");<br>+    InterlockedIncrement(&object_locks);<br> <br>     TRACE("Created system clock %p.\n", object);<br>     *out = &object->IUnknown_inner;<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2021年8月11日(水) 8:56 Zebediah Figura (she/her) <<a href="mailto:zfigura@codeweavers.com">zfigura@codeweavers.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 8/10/21 6:40 PM, 粟田大樹 wrote:<br>
> Hi, Zebediah. Thank you for your quick reply.<br>
> <br>
> It was a very interesting problem and I logged the changes in object_locks.<br>
> In my tests, object_locks goes to 0 without system_clock_inner_Release<br>
> being called.<br>
> The game I tested does not have a free version, so I apologize for not<br>
> sharing it. The game is clickable to skip video playback, and the crash<br>
> occurs when clicking.<br>
> <br>
> I have attached the log of my test for your reference. Thank you,<br>
<br>
 From examination of the code I believe the problem is that we call <br>
system_clock_create() from dsound_render_create(), which bypasses the <br>
increment.<br>
<br>
Either that should be changed to CoCreateInstance, or we should only <br>
increment object_locks from creation functions. I'm kind of leaning <br>
toward the latter, even though it's more code, since it's more <br>
consistent (along the lines of "always grab and release a resource in <br>
the same place").<br>
<br>
I note also that enum_reg_filter_create() and enum_moniker_create() <br>
don't reference the module, and should.<br>
</blockquote></div>