diff options
Diffstat (limited to 'linden/indra/llaudio/audioengine.cpp')
-rw-r--r-- | linden/indra/llaudio/audioengine.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/linden/indra/llaudio/audioengine.cpp b/linden/indra/llaudio/audioengine.cpp index edfa123..d5c2a40 100644 --- a/linden/indra/llaudio/audioengine.cpp +++ b/linden/indra/llaudio/audioengine.cpp | |||
@@ -134,28 +134,22 @@ void LLAudioEngine::shutdown() | |||
134 | 134 | ||
135 | // Clean up channels | 135 | // Clean up channels |
136 | S32 i; | 136 | S32 i; |
137 | if (mChannels) | 137 | for (i = 0; i < MAX_CHANNELS; i++) |
138 | { | 138 | { |
139 | for (i = 0; i < MAX_CHANNELS; i++) | 139 | if (mChannels[i]) |
140 | { | 140 | { |
141 | if (mChannels[i]) | 141 | delete mChannels[i]; |
142 | { | 142 | mChannels[i] = NULL; |
143 | delete mChannels[i]; | ||
144 | mChannels[i] = NULL; | ||
145 | } | ||
146 | } | 143 | } |
147 | } | 144 | } |
148 | 145 | ||
149 | // Clean up buffers | 146 | // Clean up buffers |
150 | if (mBuffers) | 147 | for (i = 0; i < MAX_BUFFERS; i++) |
151 | { | 148 | { |
152 | for (i = 0; i < MAX_BUFFERS; i++) | 149 | if (mBuffers[i]) |
153 | { | 150 | { |
154 | if (mBuffers[i]) | 151 | delete mBuffers[i]; |
155 | { | 152 | mBuffers[i] = NULL; |
156 | delete mBuffers[i]; | ||
157 | mBuffers[i] = NULL; | ||
158 | } | ||
159 | } | 153 | } |
160 | } | 154 | } |
161 | } | 155 | } |
@@ -575,7 +569,7 @@ LLAudioChannel * LLAudioEngine::getFreeChannel(const F32 priority) | |||
575 | } | 569 | } |
576 | } | 570 | } |
577 | 571 | ||
578 | if (min_priority > priority) | 572 | if (min_priority > priority || !min_channelp) |
579 | { | 573 | { |
580 | // All playing channels have higher priority, return. | 574 | // All playing channels have higher priority, return. |
581 | return NULL; | 575 | return NULL; |