title: static initialization and smart pointers
body: <p>Is this function guaranteed not to create any memory leaks (there is no additional allocation in <code>SomeObject</code>):</p>
  
  <pre><code>void FreeFunction()
  {
     static boost::scoped_ptr&lt;SomeObject&gt; MyStaticObject(new SomeObject);
  }
  </code></pre>
  
  <p>I never used the combination of static allocation and a smart pointer. It seems to work fine with my compiler, but I would like to know if this always cleans up the allocated memory.</p>