2013-05-20 50 views
0

我正在使用ARC in my application, for encoding the string i am using calloc`,而我在配置文件中運行應用程序時,它顯示calloc上的內存泄漏。自動引用計數不釋放calloc

enter image description here

是否ARC將釋放calloc與否?

如果沒有,爲什麼它不發佈以及如何發佈calloc

感謝,

回答

7

不幸的是ARC管理內存僅適用於Objective-C的對象,所以你的情況,你必須自己處理內存管理。

要「釋放」 calloced內存,你需要調用free上它時,它不再使用:

free(strResult);