Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0d57e9 commit ceaaef0Copy full SHA for ceaaef0
src/runtime/pythonengine.cs
@@ -573,7 +573,6 @@ public void Dispose()
573
return;
574
}
575
isDisposed = true;
576
- AcquireLock();
577
ReleaseLock();
578
GC.SuppressFinalize(this);
579
@@ -957,7 +956,10 @@ public virtual void Dispose()
957
956
AcquireLock();
958
Runtime.XDecref(globals);
959
Runtime.XDecref(locals);
960
- Py.RemoveSession(this);
+ if(this.Parent == null)
+ {
961
+ Py.RemoveSession(this);
962
+ }
963
964
965
@@ -1010,7 +1012,7 @@ public static PyScope Session(string name = null)
1010
1012
1011
1013
internal static void RemoveSession(PyScope scope)
1014
{
- if(scope.Parent == null)//top session
1015
+ if(scope.Parent == null)//top scope
1016
1017
Sessions.Remove(scope);
1018
if(scope.Name != null)
0 commit comments