PyOpenAL
PyOpenAL copied to clipboard
Python 3.8: List does not iterate over all members when mutated during loop
https://github.com/Zuzu-Typ/PyOpenAL/blob/b49212cafe21e27c540540e99aea8a5d859b95aa/openal/init.py#L815
The above line leaves dangling references in python 3.8 which causes OpenAL to crash.
To reproduce:
for iteration in range(2):
if not openal.oalGetInit():
openal.oalInit()
source1 = openal.oalOpen(path_to_a_sound)
source2 = openal.oalOpen(path_to_a_sound)
source1.play()
source2.play()
openal.oalQuit()
print(len(openal._buffers)) # This will have length 1.
The above code will crash on iteration 2 with INVALID_OPERATION.
workaround for now:
for source in openal._sources:
source.destroy()
for buffer in openal._buffers:
buffer.destroy()
before calling quit.