mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
ConsoleListener: fix crash if useThread_ is ever set false
hTriggerEvent/criticalSection/logPending_ were only initialized when useThread_ was true, but Log() falls back to SendToThread() (which uses all three) whenever the console isn't open yet, regardless of useThread_. With useThread_ false, that meant an uninitialized CRITICAL_SECTION and a null logPending_ write. Dead path today (only reachable via a commented-out line), but now initializes unconditionally. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01L4QAoxV2KY7ek4PcZw3WvY
This commit is contained in:
1 parent
1c0e5ae48c
commit
78b25599f3
1 file changed
+3
-1
@@ -49,7 +49,9 @@ ConsoleListener::ConsoleListener() : hidden_(true) {
|
||||
|
||||
// useThread_ = false;
|
||||
|
||||
if (useThread_ && !hTriggerEvent) {
|
||||
// Always initialized, since SendToThread() (used by Log() whenever the console
|
||||
// isn't open yet, regardless of useThread_) needs these to be valid.
|
||||
if (!hTriggerEvent) {
|
||||
hTriggerEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
||||
InitializeCriticalSection(&criticalSection);
|
||||
logPending_ = new char[LOG_PENDING_MAX];
|
||||
|
||||
Reference in new issue
Block a user