Fix the segmentation fault users are having when opening the video config dialog with no games visible in the game list. Although in that case there will also not be any game profiles listed in the dropdown.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7222 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2011-02-21 16:50:55 +00:00
parent 6e4923399e
commit 9bf8a58286
2 changed files with 4 additions and 2 deletions

View File

@ -28,6 +28,7 @@ LogConfigWindow::LogConfigWindow(wxWindow* parent, CLogWindow *log_window, wxWin
: wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _("Log Configuration"))
, m_LogWindow(log_window), enableAll(true)
{
SetMinSize(wxSize(100, 100));
m_LogManager = LogManager::GetInstance();
CreateGUIControls();
LoadSettings();
@ -110,7 +111,7 @@ void LogConfigWindow::LoadSettings()
{
bool log_enabled;
ini.Get("Logs", m_LogManager->getShortName((LogTypes::LOG_TYPE)i), &log_enabled, true);
if (log_enabled) enableAll=false;
if (log_enabled) enableAll = false;
m_checks->Check(i, log_enabled);
}
}

View File

@ -152,6 +152,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
for (long index = GameListCtrl->GetNextItem(-1); index != -1; index = GameListCtrl->GetNextItem(index))
{
const GameListItem* item = GameListCtrl->GetISO(GameListCtrl->GetItemData(index));
if (!item) continue;
if (item->GetUniqueID() == SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID)
{
cur_profile = index + 1;
@ -168,7 +169,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
vconfig.GameIniLoad((std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + item->GetUniqueID() + ".ini").c_str());
}
wxNotebook* const notebook = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize);
// -- GENERAL --
@ -190,6 +190,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
for (long index = GameListCtrl->GetNextItem(-1); index != -1; index = GameListCtrl->GetNextItem(index))
{
const GameListItem* item = GameListCtrl->GetISO(GameListCtrl->GetItemData(index));
if (!item) continue;
profile_cb->AppendString(wxString(item->GetName(0).c_str(), wxConvUTF8));
}