Skip to content

Commit 19a3b7e

Browse files
committed
Put decref back
1 parent 4e11fad commit 19a3b7e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src_c/mixer.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -519,14 +519,14 @@ mixer_quit(PyObject *self, PyObject *_null)
519519

520520
if (channeldata) {
521521
for (i = 0; i < numchanneldata; ++i) {
522-
if (channeldata[i].queue) {
522+
if (channeldata[i].sound) {
523523
Mix_HaltGroup(
524524
(int)(intptr_t)pgSound_AsChunk(channeldata[i].sound));
525525
}
526-
else {
527-
Mix_HaltGroup(-1);
526+
if (channeldata[i].queue) {
527+
Mix_HaltGroup(
528+
(int)(intptr_t)pgSound_AsChunk(channeldata[i].queue));
528529
}
529-
Py_XDECREF(channeldata[i].queue);
530530
}
531531
free(channeldata);
532532
channeldata = NULL;
@@ -678,10 +678,7 @@ pgSound_Play(PyObject *self, PyObject *args, PyObject *kwargs)
678678
Py_RETURN_NONE;
679679
}
680680

681-
if (channeldata[channelnum].sound) {
682-
Mix_HaltGroup(
683-
(int)(intptr_t)pgSound_AsChunk(channeldata[channelnum].sound));
684-
}
681+
Py_XDECREF(channeldata[channelnum].sound);
685682

686683
Py_XDECREF(channeldata[channelnum].queue);
687684
channeldata[channelnum].queue = NULL;

0 commit comments

Comments
 (0)