In using .NET memory profiler, I found an issue.
I have a class that is static, which contains a datatable that gets populated from a database. Since the data never changes but the application will use the data over and over I decided to make it static and do just one database transaction to get the data. This data is used to populate the items in your ComboEditor control. Here is the code:
xamComboEditorAgency.ItemsProvider.ItemsSource = Cache.Agencies.Data.DefaultView; xamComboEditorAgency.ItemsProvider.DisplayMemberPath = "Display"; xamComboEditorAgency.ItemsProvider.ValuePath = "ID";
XAML:
<igEditors:XamComboEditor Grid.Row="0" Name="xamComboEditorAgency" Theme="[current]" Value="{Binding Path=AgencyID}"> <igEditors:XamComboEditor.ItemsProvider> <igEditors:ComboBoxItemsProvider /> </igEditors:XamComboEditor.ItemsProvider> </igEditors:XamComboEditor>
.NET mem profiler shows that the control creates a ListChangedEventHandler and attaches to the defaulteView ListChanged event on the dataTable. Is there a way that I can prevent it from doing that or a way where I detach the event handler?
I believe this can cause a memory leak.
Attached is a pic of the Instance graph
Hello Rick,
I tried to create a sample based on your description and tested it with .Net profiler. I am not able to reproduce this issue may be I am missing some steps.
Please send me the version of NetAdvantage you are using. Attached is the sample. Please modify the sample to show the same.
I have noticed that you made this post a while ago. Please note, we are making efforts to ensure all posts are addressed by an Infragistics expert. We believe that the other community members could benefit from this thread as well.
Hello,i got the same problem. I modified your test-application and be able to reproduce the issue.
Reproduce Steps:
1. Start MemProfiler
2. Start "Profile application" - browse .\bin\WPF_XamCombo_BindToDataTable.exe - start it
3. Click Button "open"
4. Select an item of the ComboEditor
5. Close "Window1"
6. Memprofiler: take snapshot
7. MemProfiler Type details: You see Window1 is not disposed, because of PropertyChanged delegate by XamComboItemsProvider.CachedInfoiA. Kits