title: Confused by variable scope - destructor called unexpectedly
body: <p>I have 3 classes, Fruit, Apple and Orange, with Fruit being the parent of both. I have a static method where I do the following:</p>
  
  <pre><code>int32_t Fruit::frutificate(const Settings&amp; settings) {
    Fruit listener;
    if (settings.has_domain_socket()) {
      listener = Apple(settings);
    } else {
      listener = Orange(settings);
    }
    return uv_run(listener.loop, UV_RUN_DEFAULT);
  }
  </code></pre>
  
  <p>What confuses me is that the destructor of Apple, which runs clean up code Fruit doesn't have, is called within the condition. Apple is a child of Fruit and Fruit is declared outside the condition so shouldn't the scope last until the return?</p>