core/HandleSys.cpp
changeset 3837 f86a51ee4eb4
parent 3278 00388f39f24b
child 3838 aa2d7aa5322f
     1.1 --- a/core/HandleSys.cpp	Sun Mar 17 21:07:28 2013 +0000
     1.2 +++ b/core/HandleSys.cpp	Sun Mar 17 21:58:56 2013 +0000
     1.3 @@ -1095,12 +1095,32 @@
     1.4  		const char *type = "ANON";
     1.5  		QHandleType *pType = &m_Types[m_Handles[i].type];
     1.6  		unsigned int size = 0;
     1.7 +		unsigned int parentIdx;
     1.8 +		bool bresult;
     1.9  		if (pType->nameIdx != -1)
    1.10  		{
    1.11  			type = m_strtab->GetString(pType->nameIdx);
    1.12  		}
    1.13 +
    1.14 +		if ((parentIdx = m_Handles[i].clone) != 0)
    1.15 +		{
    1.16 +			if (m_Handles[parentIdx].refcount > 0)
    1.17 +			{
    1.18 +				size = 0;
    1.19 +				bresult = true;
    1.20 +			}
    1.21 +			else
    1.22 +			{
    1.23 +				bresult = pType->dispatch->GetHandleApproxSize(m_Handles[parentIdx].type, m_Handles[parentIdx].object, &size);
    1.24 +			}
    1.25 +		}
    1.26 +		else
    1.27 +		{
    1.28 +			bresult = pType->dispatch->GetHandleApproxSize(m_Handles[i].type, m_Handles[i].object, &size);
    1.29 +		}
    1.30 +
    1.31  		if (pType->dispatch->GetDispatchVersion() < HANDLESYS_MEMUSAGE_MIN_VERSION
    1.32 -			|| !pType->dispatch->GetHandleApproxSize(m_Handles[i].type, m_Handles[i].object, &size))
    1.33 +			|| !bresult)
    1.34  		{
    1.35  			rep("0x%08x\t%-20.20s\t%-20.20s\t%-10.10s", index, owner, type, "-1");
    1.36  		}