Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sf::Sound and sf::Music destroyed while playing  (Read 1923 times)

0 Members and 1 Guest are viewing this topic.

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
sf::Sound and sf::Music destroyed while playing
« 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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10838
    • View Profile
    • development blog
    • Email
Re: sf::Sound and sf::Music destroyed while playing
« Reply #1 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. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: sf::Sound and sf::Music destroyed while playing
« Reply #2 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.
Laurent Gomila - SFML developer