Cocos2dx reference count

Source: Internet
Author: User

A class, new or create. The reference count is 1,

If the reference count is 0, the Destructor is called.

If the delete class pointer is used, the Destructor is also called.

If a Class A's pointer is held by multiple classes, let a inherit from ref, and when each class holds a's reference, retain, and release if not needed

Cc_safe_release_null will release, and then let the pointer point to nullptr. If you change the pointer to (such as = nullptr, = NULL), The Destructor will not be called.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.