Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Thread causes a crash in SFML/wxWidgets app *solved*  (Read 1784 times)

0 Members and 1 Guest are viewing this topic.

SpectreNectar

  • Newbie
  • *
  • Posts: 39
    • View Profile
Thread causes a crash in SFML/wxWidgets app *solved*
« on: January 05, 2014, 01:52:43 am »
Hi

I'm making an application using SFML 2.0 and wxWidgets together. A level editor that opens a new window when the level is to be tested. Causing a crash why I'm unsure.

Main.cpp  - -  http://pastebin.com/WHJuCM13
application.cpp  - - http://pastebin.com/GtEwB2ji
application.h  - - http://pastebin.com/TAyBFfGg

Help much appreciated
« Last Edit: January 05, 2014, 02:11:47 pm by SpectreNectar »

Omega

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Thread causes a crash in SFML/wxWidgets app
« Reply #1 on: January 05, 2014, 02:11:55 am »
Your thread object goes out of scope before it really has a chance to do anything. Put your thread object somewhere where its scope will outlast the execution of its callback.

SpectreNectar

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: Thread causes a crash in SFML/wxWidgets app
« Reply #2 on: January 05, 2014, 02:26:04 am »
Exellent

Omega

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Thread causes a crash in SFML/wxWidgets app
« Reply #3 on: January 05, 2014, 02:36:12 am »
Does that solve your problem? If so, please mark it so.