Fixed a reference-counting problem in the external lock mechanism.

This commit is contained in:
Francis Beaudet 1999-03-10 13:56:43 +00:00 committed by Alexandre Julliard
parent 81d8613a2b
commit 9484481c84

View file

@ -1586,13 +1586,20 @@ static void COM_ExternalLockAddRef(
{ {
COM_ExternalLock *externalLock = COM_ExternalLockFind(pUnk); COM_ExternalLock *externalLock = COM_ExternalLockFind(pUnk);
/*
* Add an external lock to the object. If it was already externally
* locked, just increase the reference count. If it was not.
* add the item to the list.
*/
if ( externalLock == EL_NOT_FOUND ) if ( externalLock == EL_NOT_FOUND )
COM_ExternalLockInsert(pUnk); COM_ExternalLockInsert(pUnk);
else else
{ externalLock->uRefCount++;
externalLock->uRefCount++; /* add an external lock */
IUnknown_AddRef(pUnk); /* add a local lock as well */ /*
} * Add an internal lock to the object
*/
IUnknown_AddRef(pUnk);
} }
/**************************************************************************** /****************************************************************************