C28624

avviso C28624: nessuna chiamata a Release() per trovare la corrispondenza con refcount incrementato da LResultFromObject

LresultFromObject aumenta il refcount sui nuovi oggetti IAccessible.

Esempio

L'esempio di codice seguente genera questo avviso.

{
 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 );
}

Nell'esempio seguente viene evitato l'errore .

{
 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();
}