-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Mac crash bug introduced by commit e0ffbf106d #5322
Conversation
Additional explanation of the problem: This means that all the logic he put in for Automatic Detection of the language is not useable on the Mac, and so the "Automatic Detection" item Brian Nixon added to the language menu should not appear on the Mac since it does not work. Note that automatic detection worked correctly on the Mac before #5176, though the Other Options dialog may not have always shown the language which BOINC was actually using. Rather than totally eliminating all the changes for automatic language detection from #5176, it would be better to just remove that portion which broke automatic detection on the Mac. |
I think I've figured out how to make this work for the Mac and still keep the (Automatic Detection) menu item. I'll work on this more later this week. |
@AenBleidd I believe this is fixed properly now. Please merge when checks pass. |
Looks good to me. Thank you for the fix! |
Fix Mac crash bug introduced by commit e0ffbf1
@CharlieFenton: Thank you for fixing this. Evidently I had assumed that asking wxWidgets about the default language couldn’t fail – though I don’t recall what led me to that line of thinking, as even a cursory look at the wxWidgets source shows that it can. |
Fixes #5321
Commit e0ffbf1 failed t check for a NULL return from
wxLocale::GetLanguageInfo(wxLANGUAGE_DEFAULT)
which causes BOINC Manager to crash if the default system locale is unknown to wxWidgets.This also means that the code added by #5176 which adds automatic selection of the language to the list of languages does not work on the Mac. In fact, that code broke automatic language selection on the Mac, which worked correctly in BOINC 7.22.2.
I have tried to guard the new automatic language selection code with
#ifndef __WXMAC__
, but I am getting an assert from wxWidgets "Invalid combobox index" if I scroll all the way to the top of the language selection combo box.@BrianNixon can you please look at this and tel me what more I need to do. Also, please note that line 752 of DlgOptions.cpp also calls
wxLocale::GetLanguageInfo(wxLANGUAGE_DEFAULT)
without checking for a NULL return.I have also fixed 4 compiler warnings introduced by commit 59eb2c2.