title: SFML program having thread errors
body: <p>I've recently started using the Library SFML with visual studios 2012 c++.</p>
  
  <p>It all worked fine until i started to use custom fonts, and then these messages popped up and nothing worked:</p>
  
  <pre><code>'Graphics test.exe' (Win32): Loaded 'C:\Users\Oliver Bolt\Documents\Visual Studio 2012\Projects\Graphics test\Debug\Graphics test.exe'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Program Files\AVAST Software\Avast\snxhk.dll'. Cannot find or open the PDB file.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\opengl32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\lpk.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usp10.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\glu32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ddraw.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dciman32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp110d.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr110d.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nvinit.dll'. Cannot find or open the PDB file.
  'Graphics test.exe' (Win32): Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\_etoured.dll'. Cannot find or open the PDB file.
  'Graphics test.exe' (Win32): Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\Nvd3d9wrap.dll'. Cannot find or open the PDB file.
  'Graphics test.exe' (Win32): Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\nvdxgiwrap.dll'. Cannot find or open the PDB file.
  'Graphics test.exe' (Win32): Loaded 'C:\PROGRA~2\OPTIMI~1\OPTPRO~1.DLL'. Module was built without symbols.
  'Graphics test.exe' (Win32): Unloaded 'C:\PROGRA~2\OPTIMI~1\OPTPRO~1.DLL'
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ig7icd32.dll'. Cannot find or open the PDB file.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\igdusc32.dll'. Cannot find or open the PDB file.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\version.dll'
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dinput.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\hid.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wintrust.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msasn1.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Symbols loaded.
  'Graphics test.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ole32.dll'
  The thread 0xed8 has exited with code 0 (0x0).
  The thread 0x131c has exited with code 0 (0x0).
  The thread 0x105c has exited with code 0 (0x0).
  The thread 0x19e8 has exited with code 0 (0x0).
  The thread 0xeb4 has exited with code 0 (0x0).
  The thread 0x187c has exited with code 0 (0x0).
  The thread 0x1c78 has exited with code 0 (0x0).
  The thread 0x480 has exited with code 0 (0x0).
  The thread 0x1244 has exited with code 0 (0x0).
  The program '[4124] Graphics test.exe' has exited with code 0 (0x0).
  </code></pre>
  
  <p>The program that caused these errors:</p>
  
  <pre><code>#include &lt;SFML\System.hpp&gt;
  #include &lt;SFML\Graphics.hpp&gt;
  #include &lt;ctime&gt;
  #include &lt;sstream&gt;
  
  using namespace sf;
  using namespace std;
  
  int main()
  {
      VideoMode videoMode(320, 240);
      RenderWindow window(videoMode, "Plus or minus");
  
      Font font;
      if (!font.loadFromFile("TOMB.TTF"))
      {
          return EXIT_FAILURE;
      }
  
      Text title("Plus Or Minus", font, 20);
      title.setPosition(10, 10);
      title.setColor(Color::White);
  
      Text question("What is your guess ?",font,20);
      question.setPosition(5,30);
      question.setColor(Color::White);
  
      Text enter("", font, 20);
      enter.setPosition(5, 50);
      enter.setColor(Color::Green);
      String textEntered;
      int numEntered = 0;
  
      Text status("", font, 16);
      status.setPosition(100, 50);
      status.setColor(Color::Yellow);
      stringstream out("");
  
      Text won("You have discovered\n the secret number\n in less than 10 tries,\n well played !", font, 20);
      won.setPosition(5, 70);
      won.setColor(Color::Green);
  
      Text lost("You have failed to\n discover the secret\n number in less than\n 10 tries, better \nluck next time!", font, 20);
      lost.setPosition(5, 70);
      lost.setColor(Color::Red);
  
      srand(static_cast&lt;unsigned int&gt; (time(NULL)));
  
      int secretNumber = rand() % 100;
  
      bool isGameOn = true;
      bool playerWon = false;
      int tryNumber = 0;
  
      while (window.isOpen())
      {
          window.clear();
          window.draw(title);
          if (isGameOn)
          {
              window.draw(question);
              window.draw(enter);
              window.draw(status);
          }
          else
          {
              if (playerWon)
              {
                  window.draw(won);
              }
              else
              {
                  window.draw(lost);
              }
          }
  
          window.display();
  
          Event event;
          while (window.pollEvent(event))
          {
              if ((event.type == Event::Closed) || ((event.type == Event::KeyPressed) &amp;&amp; (event.key.code == Keyboard::Escape)))
              {
                  window.close();
              }
  
              if (event.type == Event::TextEntered)
              {
                  char c = static_cast&lt;char&gt; (event.text.unicode);
                  if (c &gt;= '0' &amp;&amp; c &lt;= '9')
                  {
                      textEntered += event.text.unicode;
                      enter.setString(textEntered);
                  }
                  else if (c == '\r')
                  {
                      tryNumber++;
  
                      stringstream in(enter.getString());
                      in &gt;&gt; numEntered;
  
                      if (numEntered &gt; secretNumber)
                      {
                          out &lt;&lt; tryNumber;
                          out &lt;&lt; ". ";
                          out &lt;&lt; numEntered;
                          out &lt;&lt; ": Minus" &lt;&lt; endl;
                          status.setString(out.str());
                      }
                      if (numEntered &lt; secretNumber)
                      {
                          out &lt;&lt; tryNumber;
                          out &lt;&lt; ". ";
                          out &lt;&lt; numEntered;
                          out &lt;&lt; ": Plus" &lt;&lt; endl;
                          status.setString(out.str());
                      }
                      if (numEntered == secretNumber)
                      {
                          playerWon = true;
                          status.setString("");
                          isGameOn = false;
                      }
                      if (tryNumber &gt; 10)
                      {
                          playerWon = false;
                          status.setString("");
                          isGameOn = false;
                      }
                      textEntered = "";
                  }
              }
          }
          return EXIT_SUCCESS;
      }
  }
  </code></pre>
  
  <p>I have searched around, but i didn't really find an answer to this problem, would be really grateful if someone could help me solve this! :)</p>
  
  <p>Best Regards</p>
  
  <p>FreeSirenety</p>