我需要在 Destructor 中删除 CriticalSection 吗?
Do I need to DeleteCriticalSection in Destructor?
我是 C++ 的新手,在我的程序中我有一个 class,它有一个私有成员 (CRITICAL_SECTION csPtr
)。
InitializeCriticalSection(&csPtr)
在我的构造函数中被调用。
我的问题是,我需要在析构函数中调用 DeleteCriticalSection(&csPtr)
吗?
A critical section object cannot be moved or copied. The process must also not modify the object, but must treat it as logically opaque. Use only the critical section functions to manage critical section objects. When you have finished using the critical section, call the DeleteCriticalSection
function.
我是 C++ 的新手,在我的程序中我有一个 class,它有一个私有成员 (CRITICAL_SECTION csPtr
)。
InitializeCriticalSection(&csPtr)
在我的构造函数中被调用。
我的问题是,我需要在析构函数中调用 DeleteCriticalSection(&csPtr)
吗?
A critical section object cannot be moved or copied. The process must also not modify the object, but must treat it as logically opaque. Use only the critical section functions to manage critical section objects. When you have finished using the critical section, call the
DeleteCriticalSection
function.