Releasing Core Foundation object references

后端 未结 5 1634
耶瑟儿~
耶瑟儿~ 2021-01-31 19:21

Do I need to release a Core Foundation objects to clear up memory? And if so, how?

For example, in the code:

ABAddressBookRef addressBook = ABAddressBook         


        
5条回答
  •  南旧
    南旧 (楼主)
    2021-01-31 20:05

    Yes, in CoreFoundation you have to release anything with Create or Copy in the name. You do this with CFRelease(). In your case, you should be releasing both the array and the address book references.

提交回复
热议问题