ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > irrKlang
forum topic indicator Do you need to call drop() on every ISound *?
person icon
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

person icon
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.

person icon
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:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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