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

Commit8d61215

Browse files
committed
when process is exiting, there's no need to save live .NET objects as they won't be resurrected
1 parentec8b69f commit8d61215

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

‎src/runtime/pythonengine.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ static void OnDomainUnload(object _, EventArgs __)
296296

297297
staticvoidOnProcessExit(object_,EventArgs__)
298298
{
299+
Runtime.ProcessIsTerminating=true;
299300
Shutdown();
300301
}
301302

‎src/runtime/runtime.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ internal static int GetRun()
9292
}
9393

9494
internalstaticboolHostedInPython;
95+
internalstaticboolProcessIsTerminating;
9596

9697
/// Initialize the runtime...
9798
/// </summary>
@@ -254,7 +255,7 @@ internal static void Shutdown()
254255

255256
varstate=PyGILState_Ensure();
256257

257-
if(!HostedInPython)
258+
if(!HostedInPython&&!ProcessIsTerminating)
258259
{
259260
// avoid saving dead objects
260261
TryCollectingGarbage(runs:3);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp