开发者

Silverlight Memory Leak

开发者 https://www.devze.com 2023-02-07 10:47 出处:网络
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 i.e. PageActivity, DataTemplates etc. and it\'s nothing like that

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 i.e. 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


Ok, so we actually just bought the Telerik Tools for silverlight but if you really want to go through the trouble you can go look in the source code of the toolkit (Nov 2009, the newer versions should be fixed) and then just unsubscribe the eventhandlers after you've closed the calendar popup.

0

精彩评论

暂无评论...
验证码 换一张
取 消