diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-D664843A-0741-5E38-88D0-D8BEC9C732EB.dita --- a/Symbian3/PDK/Source/GUID-D664843A-0741-5E38-88D0-D8BEC9C732EB.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-D664843A-0741-5E38-88D0-D8BEC9C732EB.dita Thu Mar 11 18:02:22 2010 +0000 @@ -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