Silverlight Memory Leak

I've been struggling with this for a while now and I really can't find a solution. I've checked all the standard memory leak issues ie PageActivity, DataTemplates etc. and it's nothing like that. I am using windbg and with !GCRoot I get:

DOMAIN(097C9970):HANDLE(Pinned):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)

Is there any way I can find out with more detail where is the leak?

It happens when I change the selected value of the combobox

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

The Code behing for the event is:

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

When the control is unloaded I've tried setting the DataContext = null; as well as a host of other controls and variables that I thought might cause the leak


好吧,我们实际上刚刚购买了Silverlight的Telerik工具,但如果您真的想要经历麻烦,您可以查看该工具包的源代码(2009年11月,应该修复较新的版本),然后取消订阅事件处理程序关闭日历弹出窗口后。

链接地址: http://www.djcxy.com/p/22786.html

上一篇: 在WP7 UserControl中执行DataBinding的正确方法

下一篇: Silverlight内存泄漏