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 <notifications@github.com><br>
wrote:<br>
<br>
> Yeah, it could be just if (singleton) but in the past I think I wrote it<br>
> out for the sake of clarity. Feel free to change it if you like, but I'm<br>
> fine with it either way.<br>
><br>
> —<br>
> Reply to this email directly or view it on GitHub<br>
> <https://github.com/mlpack/mlpack/pull/521#issuecomment-188800269>.<br>
><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;">—<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>