叮当小说网 找小说网 无限小说网 红尘小说网 幻想小说网 酷文学 深夜书屋

2005年3月26日

使用Singleton需要考虑内存释放

摘要: GoF[p84]所说的Singleton没有考虑到内存的释放解决方法:1、加入一个成员函数DestroyInstance()来释放内存,在整个工程中需且仅需调用DestroyInstance()一次。2、ME中说用智能指针 阅读全文

posted @ 2005-03-26 15:26 麦哲思科技 阅读(90) 评论(0) 推荐(0)

std::oststream VS std::ostringstream

摘要: 用如下程序段在for循环中分别测试std::oststream 和 std::ostringstream,可以发现std::oststream 有内存泄露,最好使用std::ostringstream。 std::ostringstream oss, oss2; std::string ... 阅读全文

posted @ 2005-03-26 15:13 麦哲思科技 阅读(148) 评论(0) 推荐(0)

导航