删除wpf C#代码中Iron Python的静态引用

删除wpf C#代码中Iron Python的静态引用,c#,python,.net,wpf,ironpython,C#,Python,.net,Wpf,Ironpython,我使用dll IronPython.dll和IronPython.Wpf.dll,使用ScriptEngine和ScriptScope在C#代码中运行Iron Python 我正在运行WPF c#代码中的Iron Python脚本 源文件中的脚本有几个方法,可以作为 Func<object> func = scope.GetVariable("scriptMethodName"); func(); 此问题导致严重的内存泄漏,是否有可能获取主窗口使用的内存并明确清除它自提交修复程序以

我使用dll IronPython.dll和IronPython.Wpf.dll,使用ScriptEngine和ScriptScope在C#代码中运行Iron Python

我正在运行WPF c#代码中的Iron Python脚本

源文件中的脚本有几个方法,可以作为

Func<object> func = scope.GetVariable("scriptMethodName");
func();
此问题导致严重的内存泄漏,是否有可能获取主窗口使用的内存并明确清除它

自提交修复程序以来的情况。
Func<object> func = scope.GetVariable("scriptMethodName");
func();
IronPython.Runtime.CodeContext <0x2890FCC> [Static variable temp$2.$constant1]
Dictionary<string, object> options = new Dictionary<string, object>();
options["Debug"] = true;
options["LightweightScopes"] = true;
engine.Runtime.Shutdown();
scope.Engine.Runtime.Shutdown();