Skip to content

Uninitialisation order for sounds with data sources (noise and waveform) #729

Answered by mackron
Oldes asked this question in Q&A
Discussion options

You must be logged in to vote

You are correct - you need to uninitialize the sound before the data source. The reason is that the two are decoupled, and since the sound is pulling from the data source, you would be pulling the data source from under the sound if you were to uninitialize it first.

When I would like to reuse the datasource struct (like noise), is it safe to uninit the sound where it was used and initialise another sound with the noise struct?

This should be safe, yes.

Am I right, that the datasource should be used only with one sound?

Yes, you should only have a singe sound referencing a data source at any given time.

The missing waveform uninit in that example is an oversight. I'll need to address …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Oldes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants