Aracılığıyla paylaş


C28624

uyarı C28624: LResultFromObject'ten artımlı refcount ile eşleşecek Release() çağrısı yok

LresultFromObject yeni IAccessible nesnelerinde refcount değerini artırır.

Örneği

Aşağıdaki kod örneği bu uyarıyı oluşturur.

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

Aşağıdaki örnek hatadan kaçınıyor.

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