Function: finalize_reference
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Performs deinitialization to destroy the resources used by the ACL API in the process.
acl.finalize_reference involves the implementation of reference counting. Each time acl.init is called, the reference count increases by 1. Each time acl.finalize_reference is called, the reference count decreases by 1. Deinitialization is performed only when the reference count decreases to 0. The difference between acl.finalize and this API is that calling acl.finalize clears the count and directly deinitializes the resources.
Prototype
- C Prototype
1aclError aclFinalizeReference(uint64_t *refCount)
- Python Function
1count, ret = acl.finalize_reference()
Parameter Description
None
Return Value Description
Return Value |
Description |
|---|---|
count |
Int, reference count. |
ret |
Int, error code: 0 on success; else, failure. |
Restrictions
Before exiting the application process, ensure that aclFinalize or acl.finalize_reference has been called to complete deinitialization. Otherwise, there may be exceptions. For example, an error is reported when the application process exits.
You are not advised to call aclFinalize or acl.finalize_reference in the destructor call. Otherwise, the process may exit abnormally due to the unknown singleton destruction sequence.