Commit 6f917d49 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

ole32: Fix a race in find_proxy_manager.

parent 7a8eb4c5
......@@ -1097,10 +1097,15 @@ static BOOL find_proxy_manager(APARTMENT * apt, OXID oxid, OID oid, struct proxy
struct proxy_manager * proxy = LIST_ENTRY(cursor, struct proxy_manager, entry);
if ((oxid == proxy->oxid) && (oid == proxy->oid))
{
*proxy_found = proxy;
ClientIdentity_AddRef((IMultiQI *)&proxy->lpVtbl);
found = TRUE;
break;
/* be careful of a race with ClientIdentity_Release, which would
* cause us to return a proxy which is in the process of being
* destroyed */
if (ClientIdentity_AddRef((IMultiQI *)&proxy->lpVtbl) != 0)
{
*proxy_found = proxy;
found = TRUE;
break;
}
}
}
LeaveCriticalSection(&apt->cs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment