Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1285
ComboEditor not releasing object
posted

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

Parents
No Data
Reply
  • 3255
    posted

    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.

    WPF_XamCombo_BindToDataTable.zip
Children