Skip to content

Commit 9f82126

Browse files
committed
Halt playback instead of decrefing the sound in mixer_quit
1 parent f71f0c3 commit 9f82126

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src_c/mixer.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,13 @@ mixer_quit(PyObject *self, PyObject *_null)
517517

518518
if (channeldata) {
519519
for (i = 0; i < numchanneldata; ++i) {
520-
Py_XDECREF(channeldata[i].sound);
520+
if (channeldata[i].queue) {
521+
Mix_HaltGroup(
522+
(int)(intptr_t)pgSound_AsChunk(channeldata[i].sound));
523+
}
524+
else {
525+
Mix_HaltGroup(-1);
526+
}
521527
Py_XDECREF(channeldata[i].queue);
522528
}
523529
free(channeldata);

0 commit comments

Comments
 (0)