enigma-dev/enigma-dev — pull request #775 by sorlok (2014-07-14 04:03:31+00:00)
Title: Many OpenAL fixes

This pull request started with a simple bugfix: it was easy to "trick" the OpenAL backend into overwriting a previously-allocated sound with your own sound. The test case is here:
https://drive.google.com/file/d/0B1P7NepPcOslQmZiTWRlRnFMcEU

From there, I found several bugs (accessing by the wrong index, memory leaks, double-frees), and this became a very large changeset (they are all related).

Note: I also changed the OpenAL backend to not re-use IDs once they are destroyed ---Game Maker does not do this, and it makes code harder to debug in general.

Please have a look at this. If you dislike my implementation, I can re-work it to suit your specifications.