Prerequisite Checklist
Describe your issue here
When closing an sf::RenderWindow where pollEvents() has been invoked on said window, the existence of any sf::Music instances will cause an access violation crash on window closure.
Your Environment
-
OS / distro / window manager: Windows 11
-
SFML version: 3.0
-
Compiler / toolchain: MVSC
-
Special compiler / CMake flags: NA
-
Build Configuration: ASan / Debug
-
CPU: AMD Ryzen 7 5700X 8-Core
-
GPU: NVIDIA GeForce RTX 3060
Steps to reproduce
- Navigate to Settings app in Windows
- Go to Bluetooth & devices
- Go to Pen & Windows Ink
- Enable shell handwriting
- Restart your machine if it was not previously enabled
- Launch the program and close the window
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
int main() {
sf::RenderWindow window{sf::VideoMode({400, 300}), "Crash City", sf::Style::Default, sf::State::Windowed};
sf::Music music{};
while (window.isOpen()) {
while (std::optional const event = window.pollEvent()) {
if (event->is<sf::Event::Closed>()) { window.close(); }
}
window.clear();
window.display();
}
return EXIT_SUCCESS;
}
Expected behavior
Closing the window should not cause an access violation.
Actual behavior
Closing the window causes an access violation.
Prerequisite Checklist
Describe your issue here
When closing an
sf::RenderWindowwherepollEvents()has been invoked on said window, the existence of anysf::Musicinstances will cause an access violation crash on window closure.Your Environment
OS / distro / window manager: Windows 11
SFML version: 3.0
Compiler / toolchain: MVSC
Special compiler / CMake flags: NA
Build Configuration: ASan / Debug
CPU: AMD Ryzen 7 5700X 8-Core
GPU: NVIDIA GeForce RTX 3060
Steps to reproduce
Expected behavior
Closing the window should not cause an access violation.
Actual behavior
Closing the window causes an access violation.