Table of contents
TOC
Collapse the table of content
Expand the table of content

C28624

Last Updated: 11/22/2016

warning C28624: No call to Release() to match incremented refcount from LResultFromObject

LresultFromObject increases the refcount on new IAccessible objects.

Example

The following code example generates this warning.

{
 IAccessible *pacc = CreateNewIAccessible();
 LRESULT lTemp = LresultFromObject(riid, NULL, pacc );
}

{
 IAccessible *pacc = NULL;
 // Get new interface (from same object)
 QueryInterface( & pacc );

 // Lresult will internally bump up the refcount
 // to hold onto the object.

 LRESULT lTemp = LresultFromObject( riid, NULL, pacc );
}

The following example avoids the error.

{
 IAccessible *pacc = CreateNewIAccessible();
 // Lresult internally increases the refcount to
 // hold onto the object.
 LRESULT lTemp = LresultFromObject(riid, NULL, pacc );

 // We no longer need our pacc interface, so we release it.

 pacc->Release();
}

Send comments about this topic to Microsoft

© 2017 Microsoft