Skip to content

Commit 6017bed

Browse files
dos1SiegeLord
authored andcommitted
opensl: destroy player and output mixer when deallocating voice
Fixes #957
1 parent 9b36d6a commit 6017bed

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

addons/audio/opensl.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,16 @@ static void _opensl_deallocate_voice(ALLEGRO_VOICE *voice)
556556
data->poll_thread = NULL;
557557
}
558558

559+
if (data->player != NULL){
560+
(*data->player)->Destroy(data->player);
561+
data->player = NULL;
562+
}
563+
564+
if (data->output != NULL){
565+
(*data->output)->Destroy(data->output);
566+
data->output = NULL;
567+
}
568+
559569
for (i = 0; i < MAX_BUFFERS; i++){
560570
al_free(data->buffers[i]);
561571
}

0 commit comments

Comments
 (0)