aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-06-01 17:23:59 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-06-01 17:23:59 +0000
commitdc72a49b4c680fe6698b831a203a9b00e476d562 (patch)
tree1124ef61369b315b57a1d4c816d6a19fe0d9e656 /Game
parentf40e293a9d9b6c363440c2becfac281334a4e198 (diff)
downloadusdx-dc72a49b4c680fe6698b831a203a9b00e476d562.tar.gz
usdx-dc72a49b4c680fe6698b831a203a9b00e476d562.tar.xz
usdx-dc72a49b4c680fe6698b831a203a9b00e476d562.zip
Fixed a Memory Bug in UMenuSelectSlide that causes memory that is not in use anymore is not freeed when the Attributes of a SelectSlide are Updated
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@240 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game')
-rw-r--r--Game/Code/Menu/UMenuSelectSlide.pas43
1 files changed, 22 insertions, 21 deletions
diff --git a/Game/Code/Menu/UMenuSelectSlide.pas b/Game/Code/Menu/UMenuSelectSlide.pas
index 0149ea2b..f18b45cd 100644
--- a/Game/Code/Menu/UMenuSelectSlide.pas
+++ b/Game/Code/Menu/UMenuSelectSlide.pas
@@ -308,33 +308,34 @@ begin
if (Lines <= 0) then
Lines := 1;
+ //Free old Space used by Texts
+ For I := low(TextOpt) to high(TextOpt) do
+ TextOpt[I].Free;
+
setLength (TextOpt, Lines);
for I := low(TextOpt) to high(TextOpt) do
begin
+ TextOpt[I] := TText.Create;
+ TextOpt[I].Size := Text.Size;
+ //TextOpt[I].Align := 1;
+ TextOpt[I].Align := 0;
+ TextOpt[I].Visible := True;
- //TextOpt[I] := TextOpt[0];
- TextOpt[I] := TText.Create;
- TextOpt[I].Size := Text.Size;
- //TextOpt[I].Align := 1;
- TextOpt[I].Align := 0;
- TextOpt[I].Visible := True;
-
- TextOpt[I].ColR := STDColR;
- TextOpt[I].ColG := STDColG;
- TextOpt[I].ColB := STDColB;
- TextOpt[I].Int := STDInt;
-
- //Generate Positions
- //TextOpt[I].X := TextureSBG.X + 20 + (TextureSBG.W / Lines) * (I + 0.5);
- TextOpt[I].X := TextureSBG.X + 20 + (TextureSBG.W / Lines) * I;
- TextOpt[I].Y := TextureSBG.Y + (TextureSBG.H / 2) - 1.5 * Text.Size{20};
-
- //Better Look with 2 Options
- if (Lines=2) AND (Length(TextOptT)= 2) then
- TextOpt[I].X := TextureSBG.X + 20 + (TextureSBG.W -40 - glTextWidth(PChar(TextOptT[1]))) * I;
+ TextOpt[I].ColR := STDColR;
+ TextOpt[I].ColG := STDColG;
+ TextOpt[I].ColB := STDColB;
+ TextOpt[I].Int := STDInt;
+
+ //Generate Positions
+ //TextOpt[I].X := TextureSBG.X + 20 + (TextureSBG.W / Lines) * (I + 0.5);
+ TextOpt[I].X := TextureSBG.X + 20 + (TextureSBG.W / Lines) * I;
+ TextOpt[I].Y := TextureSBG.Y + (TextureSBG.H / 2) - 1.5 * Text.Size{20};
+
+ //Better Look with 2 Options
+ if (Lines=2) AND (Length(TextOptT)= 2) then
+ TextOpt[I].X := TextureSBG.X + 20 + (TextureSBG.W -40 - glTextWidth(PChar(TextOptT[1]))) * I;
end;
- //TextOpt[I] := TextOpt[0];
end;
end.