Do not ASSERT that the object is not exclusively locked in GDIOBJ_vDereferenceObject. The idea behind this was to easily detect cases where someone would accidentally dereference an object, instead of unlocking it. But this function is used from other functions, that can definately deal with exclusively locked objects. Changing this would leat to code duplication / more complex code.
Forgetting to unlock an object will still be detected by the kernel, when returning to user mode, since APC would still be disabled.
Should fix failed assertion when running dx9 setup.

svn path=/trunk/; revision=56525
This commit is contained in:
Timo Kreuzer 2012-05-06 11:51:57 +00:00
parent f2e65997ea
commit 366d8d52e3

View file

@ -476,9 +476,7 @@ GDIOBJ_vDereferenceObject(POBJ pobj)
{
ULONG cRefs, ulIndex;
/* Must not be exclusively locked */
ASSERT(pobj->cExclusiveLock == 0);
/* Log the event */
DBG_LOGEVENT(&pobj->slhLog, EVENT_DEREFERENCE, cRefs);
/* Check if the object has a handle */
@ -489,10 +487,10 @@ GDIOBJ_vDereferenceObject(POBJ pobj)
/* Decrement reference count */
ASSERT((gpaulRefCount[ulIndex] & REF_MASK_COUNT) > 0);
cRefs = InterlockedDecrement((LONG*)&gpaulRefCount[ulIndex]) & REF_MASK_INUSE;
cRefs = InterlockedDecrement((LONG*)&gpaulRefCount[ulIndex]);
/* Check if we reached 0 and handle bit is not set */
if (cRefs == 0)
if ((cRefs & REF_MASK_INUSE) == 0)
{
/* Make sure it's ok to delete the object */
ASSERT(pobj->BaseFlags & BASEFLAG_READY_TO_DIE);