Skip to content

Commit 28a6969

Browse files
committed
Fix AudioServer missing deletes.
1 parent cae3d72 commit 28a6969

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

servers/audio_server.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,7 @@ void AudioServer::start_playback_stream(Ref<AudioStreamPlayback> p_playback, con
12301230
int idx = 0;
12311231
for (KeyValue<StringName, Vector<AudioFrame>> pair : p_bus_volumes) {
12321232
if (pair.value.size() < channel_count || pair.value.size() != MAX_CHANNELS_PER_BUS) {
1233+
delete playback_node;
12331234
delete new_bus_details;
12341235
ERR_FAIL();
12351236
}
@@ -1322,8 +1323,10 @@ void AudioServer::set_playback_bus_volumes_linear(Ref<AudioStreamPlayback> p_pla
13221323
if (idx >= MAX_BUSES_PER_PLAYBACK) {
13231324
break;
13241325
}
1325-
ERR_FAIL_COND(pair.value.size() < channel_count);
1326-
ERR_FAIL_COND(pair.value.size() != MAX_CHANNELS_PER_BUS);
1326+
if (pair.value.size() < channel_count || pair.value.size() != MAX_CHANNELS_PER_BUS) {
1327+
delete new_bus_details;
1328+
ERR_FAIL();
1329+
}
13271330

13281331
new_bus_details->bus_active[idx] = true;
13291332
new_bus_details->bus[idx] = pair.key;

0 commit comments

Comments
 (0)