with Unchecked_Deallocation, String_Access_Class; package body Access_To_Array_Of_String_Access_Class is -- See Note 1. procedure Internal_Free is new Unchecked_Deallocation (Object => Array_Of_String_Access, Name => Array_Of_String_Access_Access); -- See Note 2. procedure Free (Str_Access : in out Array_Of_String_Access_Access) is begin for This_String_Index in Str_Access.all'RANGE loop -- See Note 3. declare Temp : String_Access_Class.String_Access := String_Access_Class.String_Access (Str_Access (This_String_Index)); begin String_Access_Class.Free (Temp); Str_Access (This_String_Index) := null; end; end loop; Internal_Free (Str_Access); end Free; end Access_To_Array_Of_String_Access_Class; -- Notes: -- ~~~~~ -- -- 1. Internal_Free actually performs the storage reclaimation for -- Array_Of_String_Access objects. -- -- 2. Free calls inherited.Free (from the String_Access_Class) -- to free the storage for the components before freeing the storage for -- the array. -- -- 3. Because of an implementation restriction on the Alsys 4.3 compiler, -- the block is needed. Ideally, I should be able to convert the derived -- String_Access to the parent type and use this value as the parameter. -- However, Alsys 4.3 apparently does not like that in out mode of the -- formal type. Ideally, on the "copy back," the parent type value is -- converted back to the derived type. It appears that this is not -- possible in this implementation. Given this, Temp is created as an -- object of the parent type and the conversion occurs during its -- initialization. Following the call to free, null must be assigned to -- Str_Access (This_String_Index) because that access object was not directly -- used in the call.