<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What's wrong with this code #7 - Discussion</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/05/27/422718.aspx</link><description>In this edition , I presented a small chunk of code that attempted to hook the signal handlers, so that we could do something smart when the user hits CTRL-C, rather than just rolling over and dying (rolling over optional). 
 But before I discuss the</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: What's wrong with this code #7 - Discussion</title><link>http://blogs.msdn.com/b/ericgu/archive/2005/05/27/422718.aspx#423130</link><pubDate>Mon, 30 May 2005 06:00:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:423130</guid><dc:creator>Matt Garven</dc:creator><description>Eric, a slight correction to my comment in your previous post - I think the local ConsoleCtrl in your Main method is eligible for GC when a debugger is not attached (I had previously said &amp;quot;in release mode&amp;quot; which is not the case).&lt;br&gt;&lt;br&gt;We've seen this behaviour in our unit tests in particular cirumstances.&lt;br&gt;&lt;br&gt;I think before you say &amp;quot;everything is fine&amp;quot;, you should add this line after your Thread.Sleep line:&lt;br&gt;&lt;br&gt;GC.KeepAlive(consoleCtrl);&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=423130" width="1" height="1"&gt;</description></item></channel></rss>