1
votes

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

1
Just my 2 cents but have you looked into VS2010 SP1, its in Beta but its supposed to have a silverlight profiler? (Its called Performance Wizard) rabeb.wordpress.com/2010/12/18/… - gideon
@Giddy: I think thats only found in the Ultimate edition. - AnthonyWJones
You must have some idea of the source code that goes along with this? - AnthonyWJones
Thanks for the responses, will have a look into the performance profiler. In terms of the source code, i've got everything readily available but there is really nothing strange going on: - TBohnen.jnr
I'm a bit confused. How do you know you've got a memory leak? What objects are you leaking? How many are being leaked? - Gabe

1 Answers

0
votes

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.