Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
.NET does ISound.Dispose need to be called to avoid leaks

ehmdjii
Registered User
Quote
2012-11-15 15:06:41

hi,
i tried to correctly dispose the isounds once they finished playing.


isound.setSoundStopEventReceiver(this);



public void OnSoundStopped(ISound sound, StopEventCause reason, object userData)
{
if (sound != null)
{
if (sound.Finished)
{
sound.Dispose();
}
}
}


but this crashes somewhere outside .NET
source code



ehmdjii
Registered User
Quote
2012-11-15 15:08:51

just for the record here is the crash:


The runtime has encountered a fatal error. The address of the error was at 0x5db09704, on thread 0xdb0. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.


niko
Moderator
Quote
2012-11-16 08:28:00

I think it should be enough setting your ISound to null, it should be disposed by irrKlang anyway.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact