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

Commitf812ec7

Browse files
committed
Revert "handle ProcessExit event to avoid Python crash when CLR (in particular Mono) is unloaded before Python stops"
This reverts commit39af4cb.
1 parent651d145 commitf812ec7

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

‎src/runtime/pythonengine.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true,
192192

193193
// Make sure we clean up properly on app domain unload.
194194
AppDomain.CurrentDomain.DomainUnload+=OnDomainUnload;
195-
AppDomain.CurrentDomain.ProcessExit+=OnProcessExit;
196195

197196
// The global scope gets used implicitly quite early on, remember
198197
// to clear it out when we shut down.
@@ -250,11 +249,6 @@ static void OnDomainUnload(object _, EventArgs __)
250249
Shutdown();
251250
}
252251

253-
staticvoidOnProcessExit(object_,EventArgs__)
254-
{
255-
Shutdown();
256-
}
257-
258252
/// <summary>
259253
/// A helper to perform initialization from the context of an active
260254
/// CPython interpreter process - this bootstraps the managed runtime
@@ -325,7 +319,6 @@ public static void Shutdown(ShutdownMode mode)
325319
// If the shutdown handlers trigger a domain unload,
326320
// don't call shutdown again.
327321
AppDomain.CurrentDomain.DomainUnload-=OnDomainUnload;
328-
AppDomain.CurrentDomain.ProcessExit-=OnProcessExit;
329322

330323
PyScopeManager.Global.Clear();
331324
ExecuteShutdownHandlers();

‎src/runtime/runtime.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,6 @@ internal static void Shutdown(ShutdownMode mode)
393393
{
394394
Py_Finalize();
395395
}
396-
else
397-
{
398-
PyGILState_Release(state);
399-
}
400396
}
401397
}
402398

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp