Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita49f3a8

Browse files
authored
Take GIL when checking if error occurred on shutdown (#1836)
1 parent70e2e0a commita49f3a8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

‎src/runtime/PythonEngine.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,17 @@ public static void Shutdown()
355355
{
356356
return;
357357
}
358-
if(Exceptions.ErrorOccurred())
358+
359+
using(Py.GIL())
359360
{
360-
thrownewInvalidOperationException(
361-
"Python error indicator is set",
362-
innerException:PythonException.PeekCurrentOrNull(out_));
361+
if(Exceptions.ErrorOccurred())
362+
{
363+
thrownewInvalidOperationException(
364+
"Python error indicator is set",
365+
innerException:PythonException.PeekCurrentOrNull(out_));
366+
}
363367
}
368+
364369
// If the shutdown handlers trigger a domain unload,
365370
// don't call shutdown again.
366371
AppDomain.CurrentDomain.DomainUnload-=OnDomainUnload;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp