diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-D664843A-0741-5E38-88D0-D8BEC9C732EB.dita --- a/Symbian3/PDK/Source/GUID-D664843A-0741-5E38-88D0-D8BEC9C732EB.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-D664843A-0741-5E38-88D0-D8BEC9C732EB.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,34 +1,34 @@ - - - - - -How -to destroy the arraySimple arrays can be simply deleted. Certain arrays of pointers -may require calling a member function to delete the objects pointed to. -

If an array consists of T or R type elements, -it can be destroyed by simply deleting it:

-delete array; -

Where the array is either a CArrayPtrFlat or CArrayPtrSeg object -and the elements are pointers to CBase derived objects, then -these objects should first be destroyed by calling the ResetAndDestroy() member -function:

-array->ResetAndDestroy(); -delete array; -
Notes
    -
  • The RArray<class T> and RPointerArray<class T> types -are normally allocated on the program stack and are not deleted. However, -their array buffers are allocated on the heap and it is important that -these arrays are handled correctly to avoid memory leaks.

  • -
  • As a minimum, their Close() functions -must be called before the arrays go out of scope. Additionally, for the RPointerArray<class T> type, -the ResetAndDestroy() function may be called if the objects -represented by the array need to be deleted before the array goes out of scope.

  • -
+ + + + + +How +to destroy the arraySimple arrays can be simply deleted. Certain arrays of pointers +may require calling a member function to delete the objects pointed to. +

If an array consists of T or R type elements, +it can be destroyed by simply deleting it:

+delete array; +

Where the array is either a CArrayPtrFlat or CArrayPtrSeg object +and the elements are pointers to CBase derived objects, then +these objects should first be destroyed by calling the ResetAndDestroy() member +function:

+array->ResetAndDestroy(); +delete array; +
Notes
    +
  • The RArray<class T> and RPointerArray<class T> types +are normally allocated on the program stack and are not deleted. However, +their array buffers are allocated on the heap and it is important that +these arrays are handled correctly to avoid memory leaks.

  • +
  • As a minimum, their Close() functions +must be called before the arrays go out of scope. Additionally, for the RPointerArray<class T> type, +the ResetAndDestroy() function may be called if the objects +represented by the array need to be deleted before the array goes out of scope.

  • +
\ No newline at end of file