Hi,
I have a crash in my main code with new sf::Text. So I try this test to figure out why I have a crash :
#include <SFML/Graphics/Text.hpp>
#include <iostream>
int main(int ac, char **av)
{
sf::Font font;
// Load it from a file
if (!font.loadFromFile("./BrushcrazyDEMO.otf"))
{
std::cerr << "test" << std::endl;
}
sf::Text *text = new sf::Text("hello", font, 20);
}
With this simple test I have a lot of memory errors like that :
==24546== Invalid write of size 8
==24546== at 0x4E8687C: sf::VertexArray::VertexArray(sf::PrimitiveType, unsigned long) (in /usr/lib/libsfml-graphics.so.2.5.1)
==24546== by 0x4E8577B: sf::Text::Text(sf::String const&, sf::Font const&, unsigned int) (in /usr/lib/libsfml-graphics.so.2.5.1)
==24546== by 0x401070: main (main.cpp:12)
==24546== Address 0x8e6b930 is 0 bytes after a block of size 304 alloc'd
==24546== at 0x4C2E1CA: operator new(unsigned long) (vg_replace_malloc.c:334)
==24546== by 0x401053: main (main.cpp:12)
PS: line 12 is the line with sf::Text *.
Someone has an idea ?