From 9bf8a58286ac8569f899230708ab7886e8f2c7d3 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 21 Feb 2011 16:50:55 +0000 Subject: [PATCH] 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 --- Source/Core/DolphinWX/Src/LogConfigWindow.cpp | 3 ++- Source/Core/DolphinWX/Src/VideoConfigDiag.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinWX/Src/LogConfigWindow.cpp b/Source/Core/DolphinWX/Src/LogConfigWindow.cpp index d368f671fe..4d64002820 100644 --- a/Source/Core/DolphinWX/Src/LogConfigWindow.cpp +++ b/Source/Core/DolphinWX/Src/LogConfigWindow.cpp @@ -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); } } diff --git a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp index 9e4be6816e..5e7cc5ec67 100644 --- a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp @@ -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)); }