[wx-dev] Re: wxString(s.c_str()) thread safety (was Re: wxString
threadsafe)
Eric
crc1021 at myrealbox.com
Fri May 2 09:46:23 PDT 2008
> Of course, fixing this is trivial but the sheer amount of errors you get
> will probably put off quite a few people from upgrading. So while I still
> think that wxUSE_STL should become the default I'm afraid it's a bad idea
>to do it in 3.0. 3.2 or 4.0 maybe.
>From what I've followed in this discussion (correct me if I'm mistaken), the documented method of using wxEvtHandler::AddPendingEvent for sending events to the main thread from a worker thread may be problematic if the event contains a wxString because wxEvent.Clone() uses the copy ctor which just does a references copy.
For the short term (using the current wx library), if I derive from wxCommandEvent and override Clone() to do deep copy on the wxString, then I can use that event to safely send strings to the main thread, correct?
Eric
More information about the wx-dev
mailing list