发布网友 发布时间:2022-04-23 17:29
共1个回答
热心网友 时间:2023-10-11 01:14
IUnknown::Release Decreases the reference count of the interface by 1.
ULONG Release();
Parameters:
None
Return Values:
Returns the new reference count. This value is for diagnostic and testing purposes only.
Remarks:The object that exports the interface deallocates itself when its total reference count reaches 0. Use the IUnknown::AddRef method to increase the interface's reference count by 1.
Applications must call this method to release only those interfaces that were explicitly created in a previous call to IUnknown::AddRef,IUnknown::QueryInterface, or a creation function, such as Direct3DCreate9.
Requirements:
Header: Declared in Unknwn.h. 作用:
将dx接口的数量减1,即释放当前接口
函数原型:
ULONG Release(VOID);
返回值:
返回新的接口数。 此数值紧用于诊断和测试。
附注:
当继承接口而来的对象的总引用数量达到0时,他会释放自己。使用IUnknown::AddRef 函数可以增加
应用程序必须调用此函数释放这些接口,这些接口包括之前调用 IUnknown::AddRef IUnknown::QueryInterface产生的,也包括通过一个产生函数比如Direct3DCreate9,产生的。
注:引自DirectX sdk文档(翻译不太准确,参考)。