I meant:<br>
<br>
    delete singleton;<br>
    singleton = NULL; // Reset pointer.<br>
    delete singleton;<br>
<br>
should not crash even if the last statement is redundant, because the<br>
delete operator checks for NULL anyway.<br>
 In other words, `if(...)` is redundant whether it is<br>
`if(singleton)`<br>
or<br>
`if(singleton==NULL)`<br>
<br>
On Fri, Feb 26, 2016 at 1:15 AM, Ryan Curtin &lt;notifications@github.com&gt;<br>
wrote:<br>
<br>
&gt; Yeah, it could be just if (singleton) but in the past I think I wrote it<br>
&gt; out for the sake of clarity. Feel free to change it if you like, but I&#39;m<br>
&gt; fine with it either way.<br>
&gt;<br>
&gt; —<br>
&gt; Reply to this email directly or view it on GitHub<br>
&gt; &lt;https://github.com/mlpack/mlpack/pull/521#issuecomment-188800269&gt;.<br>
&gt;<br>
<br>
<br>
<br>
-- <br>
Joseph Chakravarti Mariadassou<br>
http://thesundayprogrammer.com<br>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/521#issuecomment-189007851">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFA3xgWF29oQk93EE_6I2f-fjExIqks5pn3ONgaJpZM4HX7Db.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/521#issuecomment-189007851"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>