[bt-devel] problem with the searchdialog solved ?

Joachim Ansorg bt-devel@crosswire.org
Tue, 10 Apr 2001 20:59:54 +0200


Hi!

I hope I found a workaround for the problem with the locale set wrong in the 
search result page.

I think this is caused by Sword's problems with thread safety.

VerseKey uses a static  member to cache the locale, and a VerseKey is used 
for the modules which use locales (Bibles and Commentaries).
But static members are not thread safe, so the first time this static member 
is used in the thread it's empty and the default english booknames are used.
The next time you search in the module it was changed at the end of the last 
SWModule::Search call and that's why it has a valid key object with a valid 
locale set.

I set at the begin of the search the key to the module so it's works.

Please test it.

Joachim