Make sure CallbackStream doesn't get destroyed before the Music

Music's destructor call's stop(), which in turn calls onSeek.
For CSFML, this requires the CallbackStream to stay alive until that point.

In C++, destructors for fields are called in reverse declaration order.
We swap the order of the fields, putting the Music after the
CallbackStream, so it gets destroyed before it.
This commit is contained in:
crumblingstatue authored and Lukas Dürrenberger committed 2021-08-02 23:54:39 +02:00
1 parent 1d05e82f25
commit 317f58fa31
1 file changed
+1 -1
+1 -1
View File
@@ -37,8 +37,8 @@
////////////////////////////////////////////////////////////
struct sfMusic
{
sf::Music This;
CallbackStream Stream;
sf::Music This;
};