diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-FE138F1A-1F52-5E9A-8EB2-5A8945A9CF30.dita --- a/Symbian3/PDK/Source/GUID-FE138F1A-1F52-5E9A-8EB2-5A8945A9CF30.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-FE138F1A-1F52-5E9A-8EB2-5A8945A9CF30.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,36 +1,36 @@ - - - - - -Destructor -requirementsThis document describes cleanup actions required for C type and -other classes. -

For C type classes, cleanup invokes the destructor. For -other types of object, other actions may be required.

-

The destructor for C type classes must be coded to release -all resources owned by the object. By definition, cleanup may occur on partially constructed -objects: the destructor may not, therefore, assume that all conditions for -a fully-constructed object hold in these circumstances. A typical situation -to watch for is calling a member function on a pointer that is initialized -in the ConstructL(), as the pointer could be NULL in -failure cases.

-

Resources will usually be indicated by pointers or handles. It is important -that such pointers or handles are null when there is no resource allocated, -and that the destructor test for a non-null value before destroying them.

-

This behaviour is facilitated in CBase -derived classes, -because their memory is guaranteed to be initially set to binary zeroes when -they are first allocated.

-

Programmers must, however, take particular care with pointers which are -used for owned objects which are repeatedly allocated and de-allocated throughout -an object’s lifetime. When such owned objects are de-allocated, the pointer -should always immediately be set to null.

-
See also

Advanced -Cleanup.

+ + + + + +Destructor +requirementsThis document describes cleanup actions required for C type and +other classes. +

For C type classes, cleanup invokes the destructor. For +other types of object, other actions may be required.

+

The destructor for C type classes must be coded to release +all resources owned by the object. By definition, cleanup may occur on partially constructed +objects: the destructor may not, therefore, assume that all conditions for +a fully-constructed object hold in these circumstances. A typical situation +to watch for is calling a member function on a pointer that is initialized +in the ConstructL(), as the pointer could be NULL in +failure cases.

+

Resources will usually be indicated by pointers or handles. It is important +that such pointers or handles are null when there is no resource allocated, +and that the destructor test for a non-null value before destroying them.

+

This behaviour is facilitated in CBase -derived classes, +because their memory is guaranteed to be initially set to binary zeroes when +they are first allocated.

+

Programmers must, however, take particular care with pointers which are +used for owned objects which are repeatedly allocated and de-allocated throughout +an object’s lifetime. When such owned objects are de-allocated, the pointer +should always immediately be set to null.

+
See also

Advanced +Cleanup.

\ No newline at end of file