Click here to Skip to main content

Comments by Jerry.Wang (Top 4 by date)

Jerry.Wang at 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 at 29-Sep-12 6:25am View
   
yes, I made a mistake, just copied the code above :)
Jerry.Wang at 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 at 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;
}
 

Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid