mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Tidy up some loops over the queue.
This commit is contained in:
@ -81,7 +81,7 @@ hsError plSoundPreloader::Run()
|
|||||||
while (fRunning)
|
while (fRunning)
|
||||||
{
|
{
|
||||||
fCritSect.Lock();
|
fCritSect.Lock();
|
||||||
for (int i = fBuffers.GetCount(); i > 0; i--)
|
while (fBuffers.GetCount())
|
||||||
{
|
{
|
||||||
templist.Append(fBuffers.Pop());
|
templist.Append(fBuffers.Pop());
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ hsError plSoundPreloader::Run()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
plAudioFileReader *reader = nil;
|
plAudioFileReader *reader = nil;
|
||||||
for (int i = templist.GetCount(); i > 0; i--)
|
while (templist.GetCount())
|
||||||
{
|
{
|
||||||
plSoundBuffer* buf = templist.Pop();
|
plSoundBuffer* buf = templist.Pop();
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ hsError plSoundPreloader::Run()
|
|||||||
// we need to be sure that all buffers are removed from our load list when shutting this thread down or we will hang,
|
// we need to be sure that all buffers are removed from our load list when shutting this thread down or we will hang,
|
||||||
// since the sound buffer will wait to be destroyed until it is marked as loaded
|
// since the sound buffer will wait to be destroyed until it is marked as loaded
|
||||||
fCritSect.Lock();
|
fCritSect.Lock();
|
||||||
for (int i = fBuffers.GetCount(); i > 0; i--)
|
while (fBuffers.GetCount())
|
||||||
{
|
{
|
||||||
plSoundBuffer* buf = fBuffers.Pop();
|
plSoundBuffer* buf = fBuffers.Pop();
|
||||||
buf->SetLoaded(true);
|
buf->SetLoaded(true);
|
||||||
|
Reference in New Issue
Block a user