title: should I use smart pointer to insure the memory free
body: <p>I did a heap allocation inside a a builder function:</p>
  <pre><code>bool build() {
     A* a = new A();
     Contener::getInstance()::add(a);
     return true;
  }
  </code></pre>
  <p>Should I use a smart pointer instead? I am afraid that the object <code>a</code> has persisted after the program has stopped.</p>