SFML community forums

Help => Audio => Topic started by: netrick on February 14, 2013, 09:20:23 pm

Title: sf::Sound and sf::Music destroyed while playing
Post by: netrick on February 14, 2013, 09:20:23 pm
What happens if a sf::Sound or sf::Music instace is destroyed while it's playing?
Will it silently stop playing or it will be a crash?
Title: Re: sf::Sound and sf::Music destroyed while playing
Post by: eXpl0it3r on February 14, 2013, 10:43:59 pm
I wonder why you would even want to know this. ;D

The question you should rather ask is: What ugly thing am I doing, that there could ever be the possibility of sf::Sound or sf::Music getting destroyed while playing? ;)

IIRC it will just stop playing. Besides that, it would've been soooo much easier to just simple test it, rather than opening a forum thread and waiting for an answer. ;)
Title: Re: sf::Sound and sf::Music destroyed while playing
Post by: Laurent on February 14, 2013, 10:48:40 pm
Quote
What happens if a sf::Sound or sf::Music instace is destroyed while it's playing?
A clean and well defined thing, and hopefully what you would expect: the sound/music stops. A library that crashes in this situation would be very badly designed and/or written.