8000 Reset gchead and refchain after shutdown by amos402 · Pull Request #754 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Reset gchead and refchain after shutdown #754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'master' into reset-gc
  • Loading branch information
filmor authored Mar 6, 2019
commit 6849df35d9dab2c1e15f962b495f721aa0ceafa8
11 changes: 11 additions & 0 deletions src/runtime/pythonengine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,16 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true,
#if PYTHON_WITH_PYDEBUG
_refChain = GetRefChainHead();
#endif
// Make sure we clean up properly on app domain unload.
AppDomain.CurrentDomain.DomainUnload += OnDomainUnload;

// Remember to shut down the runtime.
AddShutdownHandler(Runtime.Shutdown);

// The global scope gets used implicitly quite early on, remember
// to clear it out when we shut down.
AddShutdownHandler(PyScopeManager.Global.Clear);

if (setSysArgv)
{
Py.SetArgv(args);
Expand Down Expand Up @@ -320,6 +330,7 @@ public static void Shutdown()

Runtime.Shutdown();
ResetGC();

initialized = false;
}
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0