After several days chasing memory problems in my WinForms app, I've tracked the problem down to the following scenario:
The app is binding custom BindingList<T> business object lists (part of .NetTiers framework) to UltraComboEditors, and is caching some of those lists as they are static data. Now any form with one of the bound comboeditors on it is not being garbage collected, and several memory profilers I've used point to the comboeditors not being GCed because of a ListChangedEventHandler wired to the BindableValueList of the editor.This means that as long as the cached list remains live, all the forms that reference it stay in memory, and as soon as I kill off the list all of those forms are GCed.
The logical solution to me is to unhook the event handler, but I haven't had any luck finding a way to do that, and going through and force-disposing every part of the comboeditor I can find doesn't do anything to unhook the handler either.
Anyone seen this pattern and know a way to work around it?There is some talk on the net of removing event handlers using reflection and Delegate.CreateDelegate(), but haven't been able to make that work on the comboeditor yet, possibly because I don't know what the private delegate on the BindableValueList is called.
Using 2008 Vol 3 by the way.
Hi Hemesh,
I couldn't say exactly what version it was fixed in. But only the latest service release is available on the web site, anyway, So just get the latest one and it should be corrected.
How to get the latest service release - Infragistics Community
Hello There
I too am facing the same issue. Can you please let me know if this was resolved, if so in which version of the Infragistics Suite
Tx
Hemesh
Thanks Gents
This is happening on 2008 Vol 3 (8.3.20083.1009), and I don't think there have been any WinForms hot fixes since then?
I've reported it as an incident anyway, as Brian was able to reproduce it.
Thank you for bringing this to our attention. I was able to reproduce the issue you described here with a simple test. This will be addressed in a future release of the control; you should report the issue (and cross reference this post) so that you receive a notification when the fix becomes available.
Do you have the latest Hot Fix? I think I remember something like this being fixed a while ago.
If that doesn't help, see if you can duplicate the problem in a small sample project and Submit an incident to Infragistics Developer Support so they can check it out and get it corrected.