gpt4 book ai didi

ios - 如何在 -dealloc 中正确释放 CGMutablePathRef?

转载 作者:可可西里 更新时间:2023-11-01 17:02:31 25 4
gpt4 key购买 nike

问题:也许 CGMutablePathRef 已经被创建和设置,但也许还没有。

我现在在 -dealloc 中做的是:

if (path != NULL) {
CGPathRelease(path);
path = NULL;
}

这是正确的吗?

最佳答案

来自manual ,

void CGPathRelease ( CGPathRef path );

This function is equivalent to CFRelease, except that it does not cause an error if the path parameter is NULL.

所以不需要NULL检查。

关于ios - 如何在 -dealloc 中正确释放 CGMutablePathRef?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6236856/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com