diff options
author | basisbit <basisbit@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2015-08-23 14:03:21 +0000 |
---|---|---|
committer | basisbit <basisbit@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2015-08-23 14:03:21 +0000 |
commit | 003becc3c7b7773b08a693e23932c3cd6e3a0999 (patch) | |
tree | 60723755479de2d528e6c1b2f9a6d4883e57f119 /src | |
parent | 8a43116029d35501f603859a76517fc7e7147f89 (diff) | |
download | usdx-003becc3c7b7773b08a693e23932c3cd6e3a0999.tar.gz usdx-003becc3c7b7773b08a693e23932c3cd6e3a0999.tar.xz usdx-003becc3c7b7773b08a693e23932c3cd6e3a0999.zip |
* qick-fix some memory leaking after leaving MenuOptionsTheme (the covers-texture-cache doesn't need to be recreated)
ToDo: fix memory which happens in TScreenSong.GenerateThumbnails or subcalls
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3125 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | src/base/UTexture.pas | 6 | ||||
-rw-r--r-- | src/screens/UScreenSong.pas | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/base/UTexture.pas b/src/base/UTexture.pas index fb31a9b0..c0f0f396 100644 --- a/src/base/UTexture.pas +++ b/src/base/UTexture.pas @@ -110,8 +110,8 @@ type end; TTextureUnit = class - private - TextureDatabase: TTextureDatabase; + //private + public Limit: integer; @@ -132,7 +132,7 @@ type var Texture: TTextureUnit; - + TextureDatabase: TTextureDatabase; implementation uses diff --git a/src/screens/UScreenSong.pas b/src/screens/UScreenSong.pas index 50efd792..6872b77e 100644 --- a/src/screens/UScreenSong.pas +++ b/src/screens/UScreenSong.pas @@ -173,6 +173,9 @@ type function getVisibleMedleyArr(MinSource: TMedleySource): TVisArr; end; +var + ThumbnailsGenerated: boolean; //true if Thumbnails were already genearated during application run + implementation uses @@ -932,7 +935,6 @@ var I: integer; CoverButtonIndex: integer; CoverButton: TButton; - CoverTexture: TTexture; Cover: TCover; CoverFile: IPath; Song: TSong; @@ -977,9 +979,9 @@ begin // song and cover. if (Cover <> nil) then begin - CoverTexture := Cover.GetPreviewTexture(); - Texture.AddTexture(CoverTexture, TEXTURE_TYPE_PLAIN, true); - CoverButton.Texture := CoverTexture; + CoverButton.Texture := Cover.GetPreviewTexture(); + if (ThumbnailsGenerated = false) then + Texture.AddTexture(CoverButton.Texture, TEXTURE_TYPE_PLAIN, true); // set selected to false -> the right texture will be displayed CoverButton.Selected := False; @@ -987,10 +989,10 @@ begin Cover.Free; end; - // reset selection if (Length(CatSongs.Song) > 0) then Interaction := 0; + ThumbnailsGenerated := true; end; { called when song flows movement stops at a song } |