wxPostEvent Segmentation Fault when not in wxThread Entry() method

Robert Easton mark63 at azurebell.co.nz
Wed Jan 2 19:52:35 PST 2008


I worked it out. So all fixed. In then end, like always, it was a very dumb
problem ... I had at some point for some reason commented out code which set
the reference to the worker thread that was used by the logger class. No
wonder I got segmentation faults!

Anyway, I tried everything else first, before I discovered the obvious -
initialisation! Sorry for troubling you all.

Mark

Robert Easton wrote:
> 
> This problem has been driving me crazy! I have been working on it ALL DAY
> - so please, please, if someone can help me I would really appreciate it.
> I need to be ablt to send strings from my logger class to my event handler
> in my MainFrame. 
> 
> My logger class is being used by all classes in my worker thread.
> 
> 
> Robert Easton wrote:
>> 
>> I want to post a simple event to my MainFrame (to a TextCtrl) from my
>> worker thread. When I do this from within the Entry() method in my thread
>> all is fine. But if I try to do it from another method then I get a
>> segmentation fault every time! Can anyone advise what the problem might
>> be?
>> 
>> MY code is :
>> 
>> wxCommandEvent event(wxEVT_ME_EVENT);
>> event.SetString("Howdy\n");
>> wxPostEvent( m_MainWindow, event);
>> 
>> I have a pointer to m_MainWindow saved in my thread class.
>> 
>> Mark
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/wxPostEvent-Segmentation-Fault-when-not-in-wxThread-Entry%28%29-method-tp14590443p14591398.html
Sent from the wxWidgets - Users mailing list archive at Nabble.com.




More information about the wx-users mailing list