The following code crashes on android with the latest SFML version. The bug was introduced in
this commit, earlier sfml versions don't crash on this code.
#include <SFML/Graphics.hpp>
#include <memory>
int main()
{
std::shared_ptr<sf::Font> font3;
sf::Font font1;
font1.loadFromFile("sansation.ttf");
font3 = std::make_shared<sf::Font>(font1);
sf::Font font2;
font2.loadFromFile("sansation.ttf");
font3 = std::make_shared<sf::Font>(font2);
}
The backtrace that is printed in logcat:
02-09 18:10:35.218 949 949 F DEBUG : backtrace:
02-09 18:10:35.218 949 949 F DEBUG : #00 pc 00058eef /data/app/com.example.tgui-1/lib/x86/libsfml-graphics.so (FT_Stroker_Done+31)
02-09 18:10:35.218 949 949 F DEBUG : #01 pc 00019ea6 /data/app/com.example.tgui-1/lib/x86/libsfml-graphics.so (sf::Font::cleanup()+310)
02-09 18:10:35.218 949 949 F DEBUG : #02 pc 0001b91e /data/app/com.example.tgui-1/lib/x86/libsfml-graphics.so (sf::Font::~Font()+30)
02-09 18:10:35.218 949 949 F DEBUG : #03 pc 00002dee /data/app/com.example.tgui-1/lib/x86/libtgui-example.so (std::__1::__shared_ptr_emplace<sf::Font, std::__1::allocator<sf::Font> >::__on_zero_shared()+30)
02-09 18:10:35.218 949 949 F DEBUG : #04 pc 00089315 /data/app/com.example.tgui-1/lib/x86/libc++_shared.so (std::__1::__shared_weak_count::__release_shared()+53)
02-09 18:10:35.218 949 949 F DEBUG : #05 pc 00002b26 /data/app/com.example.tgui-1/lib/x86/libtgui-example.so (main+422)
02-09 18:10:35.218 949 949 F DEBUG : #06 pc 00002c98 /data/app/com.example.tgui-1/lib/x86/libtgui-example.so (sf::priv::main(sf::priv::ActivityStates*)+152)
02-09 18:10:35.218 949 949 F DEBUG : #07 pc 00002fd0 /data/app/com.example.tgui-1/lib/x86/libtgui-example.so (sf::priv::ThreadFunctorWithArg<void* (*)(sf::priv::ActivityStates*), sf::priv::ActivityStates*>::run()+16)
02-09 18:10:35.218 949 949 F DEBUG : #08 pc 0000e392 /data/app/com.example.tgui-1/lib/x86/libsfml-system.so (sf::Thread::run()+18)
02-09 18:10:35.218 949 949 F DEBUG : #09 pc 0000f54b /data/app/com.example.tgui-1/lib/x86/libsfml-system.so
02-09 18:10:35.218 949 949 F DEBUG : #10 pc 00080a93 /system/lib/libc.so (__pthread_start(void*)+56)
02-09 18:10:35.218 949 949 F DEBUG : #11 pc 00021952 /system/lib/libc.so (__start_thread+25)
02-09 18:10:35.218 949 949 F DEBUG : #12 pc 000170b6 /system/lib/libc.so (__bionic_clone+70)