From b5fea3cbf67eddc61e12a46784156294a7bcd2b2 Mon Sep 17 00:00:00 2001 From: Randalphwa <38287198+Randalphwa@users.noreply.github.com> Date: Fri, 24 Nov 2023 15:13:28 -0800 Subject: [PATCH] Fix crash in wxLogGui when wxUSE_LOG_DIALOG==0 This fixes a crash when DoShowMultipleLogMessages() is called with wxUSE_LOG_DIALOG set to 0. The code after the #else statement gets the size of the wxArrayString but then instead of accessing that array, it tried to access the m_aMessages array which is empty, resulting in a crash in the C runtime. This commit simply gets the strings from the correct array. Closes #24087. --- src/generic/logg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index fd526a2444..3dae1e7785 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -266,7 +266,7 @@ wxLogGui::DoShowMultipleLogMessages(const wxArrayString& messages, const size_t nMsgCount = messages.size(); message.reserve(nMsgCount*100); for ( size_t n = nMsgCount; n > 0; n-- ) { - message << m_aMessages[n - 1] << wxT("\n"); + message << messages[n - 1] << wxT("\n"); } DoShowSingleLogMessage(message, title, style);