Original Post
Hi I understand the whole idea behind Release() and all memory leak issues. Most people suggest setting your pointers to NULL such as: if (mypointer != NULL) { mypointer->Release(); mypointer = NULL; } I was just wondering in my own classes if I could do the following: MyClass::Release() { delete this; this = NULL; //I know this doesn't work. } I get the following error: c:\Documents and Settings\Default\My Documents\Visual Studio Projects\Scuttle\SpriteSplash.cpp(91): error C2102: '&' requires l-value Basically is there a way of the Release() of a class automatically setting itself equal to NULL? And will the destructor and all the code work correctly? Thanks Talib