Hello Hiroki, thanks for the patch!
On 8/10/21 5:38 PM, Hiroki Awata wrote:
Some games crash when the DLL is unloaded during SleepConditionVariableCS on SystemClockAdviseThread. This is due to the fact that DllCanUnloadNow returns S_OK even though the advise thread is running. Incrementing the reference count when creating the advise thread resolves it.
This doesn't seem right; the system clock object itself should be holding a reference [added by DSCF_CreateInstance(), removed by system_clock_inner_Release()] and waits for the thread to stop before removing it. Are you sure we're not leaking a reference elsewhere?