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.
There was an error while loading. Please reload this page.
1 parent 7c84b10 commit 86a97fdCopy full SHA for 86a97fd
src/embed_tests/TestFinalizer.cs
@@ -87,6 +87,18 @@ public void CollectBasicObject()
87
Assert.GreaterOrEqual(objectCount, 1);
88
}
89
90
+ [Test]
91
+ public void CollectOnShutdown()
92
+ {
93
+ MakeAGarbage(out var shortWeak, out var longWeak);
94
+ FullGCCollect();
95
+ var garbage = Finalizer.Instance.GetCollectedObjects();
96
+ Assert.IsNotEmpty(garbage);
97
+ PythonEngine.Shutdown();
98
+ garbage = Finalizer.Instance.GetCollectedObjects();
99
+ Assert.IsEmpty(garbage);
100
+ }
101
+
102
private static void MakeAGarbage(out WeakReference shortWeak, out WeakReference longWeak)
103
{
104
PyLong obj = new PyLong(1024);
0 commit comments