aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/base/UGraphic.pas70
-rw-r--r--src/menu/UMenu.pas25
2 files changed, 51 insertions, 44 deletions
diff --git a/src/base/UGraphic.pas b/src/base/UGraphic.pas
index d22744db..92256f80 100644
--- a/src/base/UGraphic.pas
+++ b/src/base/UGraphic.pas
@@ -273,7 +273,7 @@ procedure LoadTextures;
procedure InitializeScreen;
procedure LoadLoadingScreen;
procedure LoadScreens;
-procedure UnLoadScreens;
+procedure UnloadScreens;
function LoadingThreadFunction: integer;
@@ -810,41 +810,41 @@ begin
Result:= 1;
end;
-procedure UnLoadScreens;
+procedure UnloadScreens;
begin
- ScreenMain.Destroy;
- ScreenName.Destroy;
- ScreenLevel.Destroy;
- ScreenSong.Destroy;
- ScreenSing.Destroy;
- ScreenScore.Destroy;
- ScreenTop5.Destroy;
- ScreenOptions.Destroy;
- ScreenOptionsGame.Destroy;
- ScreenOptionsGraphics.Destroy;
- ScreenOptionsSound.Destroy;
- ScreenOptionsLyrics.Destroy;
-// ScreenOptionsThemes.Destroy;
- ScreenOptionsRecord.Destroy;
- ScreenOptionsAdvanced.Destroy;
- ScreenEditSub.Destroy;
- ScreenEdit.Destroy;
- ScreenEditConvert.Destroy;
- ScreenOpen.Destroy;
- //ScreenSingModi.Destroy;
- ScreenSongMenu.Destroy;
- ScreenSongJumpto.Destroy;
- ScreenPopupCheck.Destroy;
- ScreenPopupError.Destroy;
- ScreenPopupInfo.Destroy;
- ScreenPartyNewRound.Destroy;
- ScreenPartyScore.Destroy;
- ScreenPartyWin.Destroy;
- ScreenPartyOptions.Destroy;
- ScreenPartyPlayer.Destroy;
- ScreenPartyRounds.Destroy;
- ScreenStatMain.Destroy;
- ScreenStatDetail.Destroy;
+ ScreenMain.Free;
+ ScreenName.Free;
+ ScreenLevel.Free;
+ ScreenSong.Free;
+ ScreenSing.Free;
+ ScreenScore.Free;
+ ScreenTop5.Free;
+ ScreenOptions.Free;
+ ScreenOptionsGame.Free;
+ ScreenOptionsGraphics.Free;
+ ScreenOptionsSound.Free;
+ ScreenOptionsLyrics.Free;
+// ScreenOptionsThemes.Free;
+ ScreenOptionsRecord.Free;
+ ScreenOptionsAdvanced.Free;
+ ScreenEditSub.Free;
+ ScreenEdit.Free;
+ ScreenEditConvert.Free;
+ ScreenOpen.Free;
+ //ScreenSingModi.Free;
+ ScreenSongMenu.Free;
+ ScreenSongJumpto.Free;
+ ScreenPopupCheck.Free;
+ ScreenPopupError.Free;
+ ScreenPopupInfo.Free;
+ ScreenPartyNewRound.Free;
+ ScreenPartyScore.Free;
+ ScreenPartyWin.Free;
+ ScreenPartyOptions.Free;
+ ScreenPartyPlayer.Free;
+ ScreenPartyRounds.Free;
+ ScreenStatMain.Free;
+ ScreenStatDetail.Free;
end;
end.
diff --git a/src/menu/UMenu.pas b/src/menu/UMenu.pas
index dd4f257e..6bceef62 100644
--- a/src/menu/UMenu.pas
+++ b/src/menu/UMenu.pas
@@ -206,11 +206,22 @@ uses
UMenuBackgroundFade;
destructor TMenu.Destroy;
+var
+ I: integer;
begin
- if (Background <> nil) then
- begin
- Background.Destroy;
- end;
+ for I := 0 to High(Button) do
+ Button[I].Free;
+ for I := 0 to High(ButtonCollection) do
+ ButtonCollection[I].Free;
+ for I := 0 to High(SelectsS) do
+ SelectsS[I].Free;
+ for I := 0 to High(Text) do
+ Text[I].Free;
+ for I := 0 to High(Statics) do
+ Statics[I].Free;
+
+ Background.Free;
+
//Log.LogError('Unloaded Succesful: ' + ClassName);
inherited;
end;
@@ -379,11 +390,7 @@ procedure TMenu.AddBackground(ThemedSettings: TThemeBackground);
end;
begin
- if (Background <> nil) then
- begin
- Background.Destroy;
- Background := nil;
- end;
+ FreeAndNil(Background);
case ThemedSettings.BGType of
bgtAuto: begin //Automaticly choose one out of BGT_Texture, BGT_Video or BGT_Color