Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Coming in build 309, as yet unreleased
* Improved handling of dict iterations and fallbacks (removes Python 2 support code, small general speed improvement) (#2332, #2330, @Avasam)
* Fixed "Open GL Demo" (`Pythonwin/pywin/Demos/openGLDemo.py`) and restore "Font" demo in `Pythonwin/pywin/Demos/guidemo.py` (#2345, @Avasam)
* Fixed accidentally trying to raise an undefined name instead of an `Exception` in `Pythonwin/pywin/debugger/debugger.py` (#2326, @Avasam)
* Fixed PythonService DoLogMessage raising fatal GIL lock error (#2426, JacobNolan1)

Build 308, released 2024-10-12
------------------------------
Expand Down
8 changes: 5 additions & 3 deletions win32/src/PythonService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,11 @@ static PyObject *DoLogMessage(WORD errorType, PyObject *obMsg)
DWORD errorCode = errorType == EVENTLOG_ERROR_TYPE ? PYS_E_GENERIC_ERROR : PYS_E_GENERIC_WARNING;
LPCTSTR inserts[] = {msg, NULL};
BOOL ok;
Py_BEGIN_ALLOW_THREADS ok = ReportError(errorCode, inserts, errorType);
PyWinObject_FreeWCHAR(msg);
Py_END_ALLOW_THREADS if (!ok) return PyWin_SetAPIError("RegisterEventSource/ReportEvent");
Py_BEGIN_ALLOW_THREADS
ok = ReportError(errorCode, inserts, errorType);
Py_END_ALLOW_THREADS
PyWinObject_FreeWCHAR(msg); // free msg before potentially raising error
if (!ok) return PyWin_SetAPIError("RegisterEventSource/ReportEvent");
Py_INCREF(Py_None);
return Py_None;
}
Expand Down
Loading