aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/g-arrspl.adb
diff options
context:
space:
mode:
authorPascal Obry <obry@adacore.com>2007-04-06 11:21:59 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-04-06 11:21:59 +0200
commit358f47f3b16dc4af70740ae3a13a3016b20bd73a (patch)
treee68b3ce189bed3a993441a405a90602a0c30bea8 /gcc/ada/g-arrspl.adb
parent9a8bd0b556b1a5ec3f6029ce80860b6675a09b33 (diff)
downloadgcc-358f47f3b16dc4af70740ae3a13a3016b20bd73a.zip
gcc-358f47f3b16dc4af70740ae3a13a3016b20bd73a.tar.gz
gcc-358f47f3b16dc4af70740ae3a13a3016b20bd73a.tar.bz2
g-arrspl.adb (Free): New routine to free the source string.
2007-04-06 Pascal Obry <obry@adacore.com> * g-arrspl.adb (Free) [Element_Access]: New routine to free the source string. (Create): Free the source string before storing the new one. From-SVN: r123571
Diffstat (limited to 'gcc/ada/g-arrspl.adb')
-rw-r--r--gcc/ada/g-arrspl.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/g-arrspl.adb b/gcc/ada/g-arrspl.adb
index 571388a..bcbc8c4 100644
--- a/gcc/ada/g-arrspl.adb
+++ b/gcc/ada/g-arrspl.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2006, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -41,6 +41,9 @@ package body GNAT.Array_Split is
procedure Free is
new Ada.Unchecked_Deallocation (Separators_Indexes, Indexes_Access);
+ procedure Free is
+ new Ada.Unchecked_Deallocation (Element_Sequence, Element_Access);
+
function Count
(Source : Element_Sequence;
Pattern : Element_Set) return Natural;
@@ -81,6 +84,7 @@ package body GNAT.Array_Split is
Mode : Separator_Mode := Single)
is
begin
+ Free (S.Source);
S.Source := new Element_Sequence'(From);
Set (S, Separators, Mode);
end Create;