首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

调用pthread_mutex_destroy以后是否需要free

2013-03-13 
调用pthread_mutex_destroy之后是否需要free翻译自:http://stackoverflow.com/questions/6883032/do-i-nee

调用pthread_mutex_destroy之后是否需要free

翻译自:http://stackoverflow.com/questions/6883032/do-i-need-to-use-delete-after-pthread-mutex-destroy

问:

假设我有以下代码来初始化互斥变量:

pthread_mutex_t m;pthread_mutex_init(&m, NULL);pthread_mutex_destroy(&m); /* Can't free &m. 这里是引用*/
你可能传入一个指针,也可能传入引用,函数并不能区分,因此,如果你声明的是指针,则需要手动free

热点排行