Silverlight内存泄漏

时间:2011-01-31 11:24:45

标签: c# silverlight

我一直在努力解决这个问题,我真的找不到解决方案。我已经检查了所有标准内存泄漏问题,即PageActivity,DataTemplates等,它就是这样。我正在使用windbg和!GCRoot我得到了:

  

DOMAIN(097C9970):HANDLE(固定):52412f8:Root:0ade4260(System.Object []) - >
    09deab28(System.Collections.Generic.List`1 [[System.Object,mscorlib]]) - >
    0a3a8708(System.Object的[]) - >
    0a42becc(System.Windows.Shapes.Rectangle) - >
    0a4267e4(System.Windows.Controls.Grid) - >
    0a40da84(System.Windows.Controls.Primitives.CalendarDayButton) - >
    0a3cc8e8(System.Windows.Controls.Calendar) - >
    0a3ccd44(System.Windows.Input.MouseButtonEventHandler) - >
    0a3cc828(System.Windows.Controls.DatePicker) - >
    0a3cd594(System.Windows.Controls.StackPanel) - >
    0a3cd690(System.Windows.Controls.StackPanel) - >
    0a3cfcd0(System.Windows.Controls.StackPanel) - >
    0a3cfdcc(System.Windows.Controls.Border) - >
    0a3e11f0(System.Windows.Controls.ContentPresenter) - >
    0a3e00d0(System.Windows.Controls.ContentControl) - >
    0a3dffd4(System.Windows.Controls.Grid) - >
    0a3e02d0(System.Windows.Controls.Border) - >
    0a3de464(System.Windows.Controls.Grid) - >
    0a3cc160(System.Windows.Controls.Expander) - >
    0a3cc0b8(System.Windows.Controls.StackPanel) - >
    0a3d4078(System.Windows.Controls.Grid) - >
    0a3d4174(System.Windows.Controls.StackPanel) - >
    0a3d4f90(System.Windows.Controls.ContentPresenter) - >
    0a3d6398(System.Windows.Controls.ContentPresenter) - >
    0a3d4ff4(System.Windows.Controls.ContentControl) - >
    0a3d51e4(System.Windows.Controls.Grid) - >
    0a3cadd4(System.Windows.Controls.Activity) - >
    0a3caa4c(System.Windows.Controls.Grid) - >
    0a3ca310(EMSOLG.Registration.StudentPayDetails)

有什么方法可以找到更详细的漏洞在哪里?

当我更改组合框的选定值时会发生这种情况

<ComboBox x:Name="cmbPaymentMethod" Height="23" Background="LightYellow"  
 DisplayMemberPath="Value" SelectedValuePath="Key" 
 SelectedValue="{Binding intPaymentMethod,Mode=TwoWay}"
 SelectionChanged="cmbPaymentMethod_SelectionChanged" />

活动的代码是:

PageActivity.IsActive = true;
tblAppForm thisApplication = (tblAppForm)this.DataContext;
thisApplication.curInvoiceAmount = 0;
RG.Amount = ;
thisApplication.curRecovery = 0;
txtInvoiceTotal.Text = "0.00";

当控件被卸载时,我尝试设置DataContext = null;以及其他一些我认为可能导致泄漏的控件和变量

1 个答案:

答案 0 :(得分:0)

好的,所以我们实际上刚刚购买了用于Silverlight的Telerik工具,但是如果你真的想解决这个问题,你可以查看工具包的源代码(2009年11月,应该修复新版本)然后只是在关闭日历弹出窗口后取消订阅事件处理程序。