<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="https://mg.to" xmlns:dc="https://purl.org/dc/elements/1.1/">
<channel>
 <title>mg.to - Bad Eggs - Comments</title>
 <link>https://mg.to/2004/09/10/bad-eggs</link>
 <description>Comments for &quot;Bad Eggs&quot;</description>
 <language>en</language>
<item>
 <title>Bad Eggs</title>
 <link>https://mg.to/2004/09/10/bad-eggs</link>
 <description>&lt;p&gt;Do you have static objects that dynamically allocate memory at startup and carefully free it when your app exits? I&amp;#8217;ve used them in a few projects&amp;#151;more than I&amp;#8217;d want to admit.&lt;/p&gt;

&lt;p&gt;If you&amp;#8217;re throwing out a carton of bad eggs, you could take the eggs out of the carton and put them in the trash one by one, followed by the empty carton. But it&amp;#8217;s quicker and easier to just toss the whole thing in the trash.&lt;/p&gt;

&lt;p&gt;Static objects are bad eggs.&lt;/p&gt;

&lt;p&gt;I suppose the C++ runtime has to toss them all in the trash&amp;#151;call their destructors&amp;#151;because it doesn&amp;#8217;t know if those destructors really need to be run. But if they&amp;#8217;re just going to free memory there ought to be some way to skip all that.&lt;/p&gt;
</description>
 <comments>https://mg.to/2004/09/10/bad-eggs#comments</comments>
 <category domain="https://mg.to/topics/programming">Programming</category>
 <pubDate>Fri, 10 Sep 2004 17:12:40 +0000</pubDate>
 <dc:creator>Michael Geary</dc:creator>
 <guid isPermaLink="false">41 at https://mg.to</guid>
</item>
</channel>
</rss>
