AICountedObjectSuite Struct Reference
[API Suite List]
These functions allow you to maintain the reference count for Illustrator object types that are returned through plug-in APIs.
More...
#include <AICountedObject.h>
List of all members.
Public Attributes |
AIAPI ai::int32(* | AddRef )(void *object) |
| Increments an object reference count.
|
AIAPI ai::int32(* | Release )(void *object) |
| Decrements an object reference count.
|
Detailed Description
These functions allow you to maintain the reference count for Illustrator object types that are returned through plug-in APIs.
Suites for object types that are reference counted provide their own functions for incrementing and decrementing the count. You can use either those functions, or the functions in this suite, which work with any reference-counted object type.
Reference-counted objects follow these conventions:
- A function that returns a pointer to a reference-counted object increments the count before returning the object. The caller must decrement the count when the object is no longer needed.
- If a plug-in passes a reference-counted object in a message to another plug-in or as a parameter to a callback function, the plug-in should not decrement the count.
- If a plug-in passes a reference counted-object to a function that needs to keep the object beyond the duration of the call, that function increments the count. The plug-in should still decrement its count if necessary when done with the object.
- See also:
AIEntrySuite
for an exception to these rules.
- Note:
- Correctly managing reference counts can be difficult. Failure to do so results in memory leaks. It is recommended that C++ client code use the
ai::Ref
template class to automatically manage these counts.
Member Data Documentation
The documentation for this struct was generated from the following file: