Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Do you need to call drop() on every ISound *?

conqueran
Registered User
Quote
2023-08-24 19:59:44

Does drop always need to be called. Is it automatically called when an ISound * is finished or do I need to call drop myself. If I call drop() on a finished ISound * will that cause problems? I want to avoid memory leaks if possible. Thanks


erik
Registered User
Quote
2023-08-25 10:44:57

If you get a pointer to an ISound, and you don't need it anymore, always call drop().

That just means that you don't need that pointer anymore. The memory will be freed once no one is using that pointer anymore.


conqueran
Registered User
Quote
2023-08-26 23:14:34

its still not completely clear to me. In the current case I have a play list and a class member

ISound * currentMusic;




in a function I set currentMusic equal to some sound source. Do I need to call drop on the previous music before setting to new music? Even if it finished playing?


void setupNextMusicTrack()
{
//do I need to call currentMusic->drop() here?

currentMusic = soundEngine->play2D( someSource, false, true, true, false );

/////bla
///bla
}



Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (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