[PATCH] quartz: Increment reference count for the advise thread to avoid crashes caused by DLL unloading.

Hiroki Awata castaneai at by.black
Tue Aug 10 20:35:11 CDT 2021


Oh, I see. I'm not familiar with quartz and I'm not sure I can cover
everything. Would you be able to create a patch?


2021年8月11日(水) 10:23 Zebediah Figura (she/her) <zfigura at codeweavers.com>:

> On 8/10/21 7:18 PM, 粟田大樹 wrote:
> > Hi, Zebediah.
> > Thanks for the detailed research.
> > I've revert the first patch, applied the next one and the test was
> > successful!
> > Is the code fix as intended? If it is ok, I will send a PATCH v2.
> >
> > diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c
> > index 73a923a7b99..0eb339420db 100644
> > --- a/dlls/quartz/systemclock.c
> > +++ b/dlls/quartz/systemclock.c
> > @@ -338,6 +338,7 @@ HRESULT system_clock_create(IUnknown *outer, IUnknown
> > **out)
> >       list_init(&object->sinks);
> >       InitializeCriticalSection(&object->cs);
> >       object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ":
> > SystemClockImpl.cs");
> > +    InterlockedIncrement(&object_locks);
> >
> >       TRACE("Created system clock %p.\n", object);
> >       *out = &object->IUnknown_inner;
> >
>
> Well, it's not quite as simple as that hunk; now you're leaking
> references for any system clock created via CoCreateInstance(). You'll
> need to do the same for all other quartz objects, and remove the
> InterlockedIncrement() from DSCF_CreateInstance().
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210811/4ecf9c92/attachment.htm>


More information about the wine-devel mailing list