SFML community forums

Help => Graphics => Topic started by: SpectreNectar on January 05, 2014, 01:52:43 am

Title: Thread causes a crash in SFML/wxWidgets app *solved*
Post by: SpectreNectar 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
Title: Re: Thread causes a crash in SFML/wxWidgets app
Post by: Omega 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.
Title: Re: Thread causes a crash in SFML/wxWidgets app
Post by: SpectreNectar on January 05, 2014, 02:26:04 am
Exellent
Title: Re: Thread causes a crash in SFML/wxWidgets app
Post by: Omega on January 05, 2014, 02:36:12 am
Does that solve your problem? If so, please mark it so.