I have a class A
class A
{
A();
~A();
DoSomething();
}
I then declare an object and a pointer to the allocated object
A Obj;
A* pObj = &Obj;
I've found out that inside DoSomething() I am setting pObj to NULL
A::DoSomething()
{
pObj=NULL;
}
So inside a method I am killing the pointer to myself... and this isn't crashing...
note: I've noticed that in the debbuger this is (Obj const).
I am having some trouble understanding why this isn't causing any kind of corruption. I assume that this isn't safe, but I can't really understand the ramifications of this.
Cheers