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.
This commit is contained in:
Randalphwa
2023-11-30 02:24:30 +01:00
committed by Vadim Zeitlin
parent 2c1cdf9c02
commit b5fea3cbf6
+1 -1
View File
@@ -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);