Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I am having a problem with a .net desktop application using IrrKlang. The quick overview of the app is: user clicks a button, then app plays wavfile once. The problem I am seeing is after a week or so running fine the app starts consuming memory until it keeps looping in the while loop below. I am certain that the freeze occurs in the while loop, I added logging and the results showed the application stayed in the while loop. I have checked the wavfile and it is valid and plays correctly outside the app. Do I need to irrKlangEngine.Dispose(); after exiting the while loop? Shouldn't this already be taken care of? Any thoughts or suggestions would be appreciated.
|
||||
|
You could try that, maybe it helps. By the way, I hope this isn't actually the code how you are doing it. The while() loop should at least do something like a Sleep(), so that your CPU resources aren't wasted, and you are heating it up quite much then. :) |
||||
|
I'll find out if the dispose ends up working next week but I think there is something else going on. Any other suggestions? Since this application runs 24/7 and there are probably only 100 or so 30sec wavs played during a day, basically the app is sitting idle (other than db calls to see if there is a new wav. Would there be a need for a gc.collect? Sadly, that is the actual code. The empty while loop stood out the first time I saw it. I did not develop it, I am only trying to troubleshoot why a simple application crashes after 1 week of running. |
||||
|
Yes, you could also try doing gc.collect. Another way would be to only use one irrKlang device (create it globally, and reuse it), and after you are finished playing one sound, call removeAllSoundSources(). |
|