null pointer to object inside object method
<p>I have a class A</p>

<pre><code>class A
{
  A();
  ~A();

  DoSomething();
}
</code></pre>

<p>I then declare an object and a pointer to the allocated object</p>

<pre><code>A Obj;
A* pObj = &amp;Obj;
</code></pre>

<p>I've found out that inside DoSomething() I am setting pObj to NULL</p>

<pre><code>A::DoSomething()
{ 
    pObj=NULL;
}
</code></pre>

<p>So inside a method I am killing the pointer to myself... and this isn't crashing...</p>

<p>note: I've noticed that in the debbuger <em>this is (Obj</em> const).</p>

<p>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.</p>

<p>Cheers</p>
