diff --git a/reactos/dll/win32/aclui/sidcache.c b/reactos/dll/win32/aclui/sidcache.c index 21b1a1abbfd..5e8db066912 100644 --- a/reactos/dll/win32/aclui/sidcache.c +++ b/reactos/dll/win32/aclui/sidcache.c @@ -158,7 +158,11 @@ ReferenceSidCacheMgr(IN HANDLE SidCacheMgr) static VOID DereferenceSidCacheMgr(IN PSIDCACHEMGR scm) { - InterlockedDecrement(&scm->RefCount); + if (InterlockedDecrement(&scm->RefCount) == 0) + { + /* Signal the lookup thread so it can terminate */ + SetEvent(scm->LookupEvent); + } }