From 003becc3c7b7773b08a693e23932c3cd6e3a0999 Mon Sep 17 00:00:00 2001 From: basisbit Date: Sun, 23 Aug 2015 14:03:21 +0000 Subject: * 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 --- src/screens/UScreenSong.pas | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/screens') 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 } -- cgit v1.2.3