aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/USongs.pas14
1 files changed, 10 insertions, 4 deletions
diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas
index c5acec9c..2bf98151 100644
--- a/Game/Code/Classes/USongs.pas
+++ b/Game/Code/Classes/USongs.pas
@@ -149,7 +149,9 @@ begin
inherited create( false );
self.freeonterminate := true;
- SongList := TList.create();
+ // This check is needed if PseudoThread is used:
+ if not Assigned(SongList) then
+ SongList := TList.create();
{$ifdef Delphi}
fDirWatch := TDirectoryWatch.create(nil);
@@ -191,8 +193,8 @@ end;
destructor TSongs.destroy();
begin
- freeandnil( SongList );
-end;
+ freeandnil( SongList );
+end;
procedure TSongs.DoDirChanged(Sender: TObject);
begin
@@ -227,7 +229,11 @@ begin
try
fProcessing := true;
- SongList.clear;
+ {$IFDEF USE_PSEUDO_THREAD}
+ if not Assigned(SongList) then
+ SongList := TList.create();
+ {$ENDIF}
+ SongList.clear;
Log.LogError('SongList', 'Searching For Songs');
// browse directories