【问题标题】:Automatic Reference Counting is not releasing calloc自动引用计数未释放 calloc
【发布时间】:2013-05-15 00:18:48
【问题描述】:

我在配置文件中运行应用程序时使用 ARCin my application, for encoding the string i am usingcalloc`,它显示 calloc 处存在内存泄漏。

ARC 是否会释放calloc

如果没有,为什么不发布以及如何发布calloc

谢谢,

【问题讨论】:

    标签: iphone ios objective-c ipad automatic-ref-counting


    【解决方案1】:

    不幸的是,ARC 只为objective-c 对象管理内存,因此在您的情况下,您必须自己处理内存管理。

    要“释放”被调用的内存,您需要在不再使用时调用free

    free(strResult);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-15
      • 1970-01-01
      • 2011-11-09
      • 2020-05-21
      相关资源
      最近更新 更多