Click here to Skip to main content
15,885,870 members

Comments by Jerry.Wang (Top 4 by date)

Jerry.Wang 5-Nov-12 21:00pm View    
Because I am building the code for all potential platforms and I don't want to download the PDB each time.
Jerry.Wang 29-Sep-12 6:25am View    
yes, I made a mistake, just copied the code above :)
Jerry.Wang 29-Sep-12 6:16am View    
For InterlockedIncrement, you need check the result as well.
If InterlockedIncrement returns 1 for the 2nd time, that means the memory is already released.
Jerry.Wang 29-Sep-12 6:14am View    
InterlockedDecrement returns the result value, so you should do like this:

void ReleaseRef()
{
if(InterlockedDecrement (&refVal)== 0)
delete [] this;
}