Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR destined to solve #5306 issue
I don't know what realisation should be, but PJB tried to explain it to me and I tried to make it.
The main problem is that we cannot be sure that the buffer is never used anywhere else. For this reason, in order to ensure the safety of the buffer, I have decided to save a values array and upload it to the buffer when it is used. But there is another problem. We can upload audio files multiple times, and each time we save the audio to the memory. Maybe we should have another dictionary to save "string key as name and IClydeHandle as value" and audio files with the same name should be saved only once. However, if the name is the same, it does not tell us that the content is the same. In this case, we can replace older content by new and give a work to GC.
It should be modified, but I need your advice.