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 }
|