Hello,
I've spent the last few days investigating this crash, but I'm finding myself traveling in circles now.
I'm running into a heap crash when I call sf::Text::getText()
std::string stdString = text.getString();
Here's the crash message I'm running into:
Program: ...s\visual studio 2013\Projects\TextTest\x64\Debug\TextTest.exe
File: f:\dd\vctools\crt\crtw32\misc\dbgheap.c
Line: 1424
Expression: _pFirstBlock == pHead
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
I'm using Visual Studio 2013 Express.
This crash only occurs in debug.
This happens in 32bit and 64bit.
I'm using the latest stable version SFML 2.1 for Visual Studio 2012 64bit.
#include <SFML/Graphics.hpp>
int main()
{
sf::Font font;
if (!font.loadFromFile("TheanoModern-Regular.ttf"))
{
return 0;
}
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::Text text;
text.setFont(font);
text.setString(L"Hello World.\0");
std::string stdString = text.getString(); //crashes here
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(text);
window.display();
}
return 0;
}
Let me know if you need any further information.
Thank you in advance for your help!