Hi, after upgrading to SFML 2.2 - I recompiled my code (with Xcode on OSX 10.9) and suddenly get a BAD ACCESS when the program exits.
Based on Nexus' comments, I put here the minimal code to generate the problem (the result I get is attached below)
#include <SFML/Graphics/Texture.hpp>
#include <SFML/System/Thread.hpp>
#include <SFML/System/Lock.hpp>
#include <SFML/System/Mutex.hpp>
sf::Mutex gMutex;
//--- threaded F()
void tF(sf::Texture* apTex)
{ sf::Lock lock(gMutex);
apTex->loadFromFile("icon.png");
}
//=== MAIN
int main(int, char const**)
{
sf::Texture texture;
sf::Thread thread(&tF, &texture);
thread.launch();
thread.wait();
return 0;
}
It worked fine with SFML 2.1
Am I doing something wrong?