title: When will memory be deleted in singleton?
body: <p>I have seen standard(most of the people using this) singleton design pattern, but here I got confused when the memory will be deleted.</p>
  
  <p>do we have to write static delete() function explicitly and delete the memory at the end ?? </p>
  
  <pre><code>class ST
  {
   static ST* instance;
   ST(){};
  
  private :
  
   static ST* getInstance();
  
  };
  
  
  ST* ST::instance = NULL;
  ST* ST::getInstance()
  {
     //lock on mutex
    if(NULL == instance)
    {
       instance = new ST();
    }
  
  return instance;
  }
  </code></pre>