How to make object pointer NULL without setting it explicitly, without deleting explicitly and without static functions ?
I am working on a c++ application.
  In my code i have an object pointer like
      TestClass *pObj = new TestClass();
  and Member function call like pObj->close();
  Inside close() member function, i should make pObj to NULL.
  As per our requirement, TestClass users should not call delete on pObj.(Destructor of TestClass is made private intentionally for this purpose)
 Also, TestClass should not expose any static method to receive a pointer and making it NULL.

 Is there any other way to make pObj to NULL once close() is called ?

 I tried one way.
 Inside close() function, i removed constness for this pointer using const_cast.
 and took a reference of it.
 Then i made this = NULL.
 Even then calling side, pObj pointer value remains. It is not getting set to NULL.
 It may be due to the Address of this pointer and Address of pObj are different.
 Pls help.


How to make object pointer NULL without setting it explicitly, without deleting explicitly and without static functions ?
===

I am working on a c++ application.
  In my code i have an object pointer like
      TestClass *pObj = new TestClass();
  and Member function call like pObj->close();
  Inside close() member function, i should make pObj to NULL.
  As per our requirement, TestClass users should not call delete on pObj.(Destructor of TestClass is made private intentionally for this purpose)
 Also, TestClass should not expose any static method to receive a pointer and making it NULL.

 Is there any other way to make pObj to NULL once close() is called ?

 I tried one way.
 Inside close() function, i removed constness for this pointer using const_cast.
 and took a reference of it.
 Then i made this = NULL.
 Even then calling side, pObj pointer value remains. It is not getting set to NULL.
 It may be due to the Address of this pointer and Address of pObj are different.
 Pls help.

