Fix crashing corner case in screen prefs.

If the refresh limits only allowed a single refresh, the menu item constructed
had no BMessage. This caused _UpdateRefreshControls() to crash when attempting
to match the current refresh rate to the item. For simplicity, give it a message
containing the fixed refresh rate just as in all other cases. Should finally
fix #8431.
This commit is contained in:
Rene Gollent
2012-03-31 17:31:21 -04:00
parent dcfb930a98
commit cf0769649e
+3 -1
View File
@@ -316,7 +316,9 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
// frequency, like the VESA driver
BString name;
refresh_rate_to_string(min, name);
BMenuItem *item = new BMenuItem(name.String(), NULL);
BMessage *message = new BMessage(POP_REFRESH_MSG);
message->AddFloat("refresh", min);
BMenuItem *item = new BMenuItem(name.String(), message);
fRefreshMenu->AddItem(item);
item->SetEnabled(false);
} else {