Debugger: Avoid symbol map if deleted.

This isn't perfectly safe, but if the game quits very quickly, it's
possible for the symbol map to get deleted.
This commit is contained in:
Unknown W. Brackets 2020-05-23 10:26:47 -07:00
parent efee79fd71
commit 4c29697120
2 changed files with 6 additions and 5 deletions

View File

@ -597,10 +597,9 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
break;
case IDC_ALLFUNCTIONS:
{
if (g_symbolMap)
g_symbolMap->FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
break;
}
break;
default:
return FALSE;
}
@ -862,7 +861,8 @@ void CDisasm::SetDebugMode(bool _bDebug, bool switchPC)
void CDisasm::NotifyMapLoaded()
{
g_symbolMap->FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
if (g_symbolMap)
g_symbolMap->FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
ptr->clearFunctions();
ptr->redraw();

View File

@ -95,7 +95,8 @@ void CMemoryDlg::NotifyMapLoaded()
if (m_hDlg)
{
HWND list = GetDlgItem(m_hDlg,IDC_SYMBOLS);
g_symbolMap->FillSymbolListBox(list,ST_DATA);
if (g_symbolMap)
g_symbolMap->FillSymbolListBox(list, ST_DATA);
HWND lb = GetDlgItem(m_hDlg,IDC_REGIONS);
int sel = ComboBox_GetCurSel(lb);
ComboBox_ResetContent(lb);