Releasing Sound Buffers

Started by
2 comments, last by level10boy 21 years, 8 months ago
I''m fully aware that if you release a DirectSound buffer after the DirectSound COM object it was created off of has been released run-time errors will occur. Does this mean then that when releasing the DirectSound COM object itself, all the sound buffers that were created off of it are also released along with it.
Advertisement
DirectSound does not manage the buffers for you. You are responsible for releasing all the buffers you create of the DirectSound object.

Cheers,
John
John ReynoldsCreative Asylum Ltdwww.creative-asylum.com
What would be the implications then of not releasing my sound buffers. Obviously I want to release them but making sure that I don''t terminate the DS COM object before all buffers are released, could be a bit of bitch to manage.
If you do not release the buffers then the memory will not be freed. This will result in memory leaks.

Using something like a linked list of pointers can be helpful for managing the soundbuffers. This way you can guarantee you catch all the buffers.

Cheers,
John
John ReynoldsCreative Asylum Ltdwww.creative-asylum.com

This topic is closed to new replies.

Advertisement