Ambiera Forum

Discussions, Help and Support.

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

Registered User
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

Registered User
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.

Registered User
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 );


Create reply:

Posted by: (you are not logged in)

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




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



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