I have a problem when throwing exceptions at wxThread::Entry function. For example simple code
class Exception {};
class WorkThread : public wxThread
{
private:
virtual void* Entry()
{
for (int i = 0; i < 100000; i++)
{
try
{
throw Exception();
}
catch (...)
{
}
}
return NULL;
}
virtual void OnExit() {}
public:
WorkThread() { }
};
wxThread* work_thread = new WorkThread();
work_thread->Create();
work_thread->Run();
causes AV, invalid instuction error or application closing.
How to solve this problem?
PS: wxWidgets is linked as
static library (looks like otherwise it is no problem with this code). WinXP SP2, CoreDuo, MinGW 3.4.5 or 4.1.2