mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-23 14:45:04 +08:00
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:
committed by
Vadim Zeitlin
parent
2c1cdf9c02
commit
b5fea3cbf6
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user