diff options
author | eddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-01-20 18:17:19 +0000 |
---|---|---|
committer | eddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-01-20 18:17:19 +0000 |
commit | 8a73bd2301655e736bc307aad3c807f4b5310903 (patch) | |
tree | d28953753d22b29edbe97849ce17585a8a6e1c1a /Game/Code/Classes | |
parent | 126c49ab26899dd54f2beb1d91284afeb34b50b3 (diff) | |
download | usdx-8a73bd2301655e736bc307aad3c807f4b5310903.tar.gz usdx-8a73bd2301655e736bc307aad3c807f4b5310903.tar.xz usdx-8a73bd2301655e736bc307aad3c807f4b5310903.zip |
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@802 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes')
-rw-r--r-- | Game/Code/Classes/USongs.pas | 14 |
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 |