-1
是什麼如下代碼DeleteCriticalSection VS刪除CriticalSection的
void foo()
{
CRITICAL_SECTION csection;
InitializeCriticalSection(&csection);
EnterCriticalSection(&csection);
// some code goes here
delete csection;
}
void foo()
{
CRITICAL_SECTION csection;
InitializeCriticalSection(&csection);
EnterCriticalSection(&csection);
// some code goes here
DeleteCriticalSection(&csection);
}
之間的差異這是最好的方式來處置csection對象?