kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #37005
Re: Warning regarding global wxStrings and thread-safety
PS: I also have a strange sense of deja vue. Did I discover this earlier and forget already, or is my mind just playing tricks on me?
> On 2 Aug 2018, at 18:01, Jeff Young <jeff@xxxxxxxxx> wrote:
>
> I finally caught a long-standing but very infrequent crash in the debugger. It’s somewhat harrowing.
>
> wxString keeps multiple iterators on a string up-to-date with regard to editing. It keeps them in a linked list. If you reference a global string in a thread (even in a const manner, such as taking its length), wxString will create an interator in your thread, link it into the list, and then unlink it when done (with no thread safety). Sooner or later, this will crash.
>
> This is the offending line:
> wxString wildcard = wxT( "*." ) + KiCadFootprintFileExtension;
> Looks innocuous enough, doesn’t it?
>
> Anyway, something to keep in mind….
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
References