<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 一个有用的宏定义</title>
	<atom:link href="http://blog.minidx.com/2007/10/21/21.html/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.minidx.com/2007/10/21/21.html</link>
	<description>中文Adobe Flex例子,Flex实例教程,RIA资源,全文检索技术,算法和数据结构</description>
	<lastBuildDate>Tue, 17 Jan 2012 07:33:13 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: 荔枝</title>
		<link>http://blog.minidx.com/2007/10/21/21.html/comment-page-1#comment-5710</link>
		<dc:creator>荔枝</dc:creator>
		<pubDate>Fri, 06 Jun 2008 17:01:33 +0000</pubDate>
		<guid isPermaLink="false">http://minidx.com/blog/?p=21#comment-5710</guid>
		<description>#define SAFE_DELETE(p) do{delete p; p=NULL;}while(false)

大哥的这代码好像很垃圾, 为什么还要 do { } while(false);
这个可以直接去了, 而且编译器一定帮你优化去掉, 白写,
而且这不可以达到你想要的效果. 可以这样 if(p) {delere p; p=NULL;}
但这样唯一缺点就是不可以防止野指针, 还需要加个 try catch 那样异常处理就可以了.哈.
要做到安全的销毁 new 开辟的空间, 在你的饿 debug 版本中进行 try 处理是最好.</description>
		<content:encoded><![CDATA[<p>#define SAFE_DELETE(p) do{delete p; p=NULL;}while(false)</p>
<p>大哥的这代码好像很垃圾, 为什么还要 do { } while(false);<br />
这个可以直接去了, 而且编译器一定帮你优化去掉, 白写,<br />
而且这不可以达到你想要的效果. 可以这样 if(p) {delere p; p=NULL;}<br />
但这样唯一缺点就是不可以防止野指针, 还需要加个 try catch 那样异常处理就可以了.哈.<br />
要做到安全的销毁 new 开辟的空间, 在你的饿 debug 版本中进行 try 处理是最好.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 1/6 queries in 0.024 seconds using disk
Object Caching 104/226 objects using disk

Served from: blog.minidx.com @ 2012-02-09 22:02:12 -->
