Where to use CGPathRelease?

限于喜欢 提交于 2019-12-11 03:35:53

问题


I am creating a line for my SKShapeNode using a CGMutablePathRef. Reading up on the usage a bit, I came across a post saying that it's important to use CGPathRelease when you're done using the path. Now I am wondering, when can I release the path? Will releasing it while the SKShapeNode still exists do any harm?

Oh and, sorry if CGPathRelease isn't used anymore since the introduction of garbage collection, I couldn't find out if it still had to be used or not, so please correct me if it's not needed anymore.


回答1:


The node will take ownership of the CGPathRef when you set its path property. You can and should use CGPathRelease() anytime after you're done manipulating the path and have passed it to the node.



来源:https://stackoverflow.com/questions/22464742/where-to-use-cgpathrelease

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!