Click here to Skip to main content
13,005,823 members (89,351 online)

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;

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