Hi,
I am attaching sample with 3 forms.
1st is the main one with 3 buttons - "No Leak Form", "Leaking Form" and "GC"
2nd is empty form
3rd is form with three ComboBoxAdv control (library version 4.2.0.37)
How to reproduce:
1. Start Task Manager, make sure that columns showing GDI and USER objects count are visible.
2. Start Attached application.
3. After it started hit GC button. Take note of GDI and USER objects count in task manager
4. Hit "No Leak Form" button. 5 forms will appear, take note of GDI/USER objects count (it should go up) in task manager.
5. Close all 5 forms (not main one).
6. Hit GC button. Take note of GDI/USER objects count int task manager (should be either the same or almost the same as count in step 3).
7. Hit "Leaking Form" button. 5 forms with 3 ComboBoxAdv will appear. Take note of GDI/USER objects count.
8. Close all 5 forms (not main one).
9. Hit GC button. Take note of GDI/USER objects count int task manager). At this point you can observe that GDI/USER objects count is almost unchanged from step 7. Thus I believe ComboBoxAdv is leaking.
If you will repeat steps 7-9 gdi/user objects count will keep growing and if form is complex with numerous ComboBoxAdvs and form is opened/closed frequently it is possible by the end of day to receive GDI+ general exception or exception loading images when handles count reaches extreme levels.
Using tool from
http://msdn.microsoft.com/msdnmag/issues/03/01/GDILeaks/ it appears that Default WinForms icon for form is being not disposed and .Net Memory Profiler from
http://memprofiler.com/ seems to confirm that (there are icons not being disposed), although forms and comboboxes are disposed properly.
I hope you can provide me with solution to this.
Looking further it seems that ComboBoxAdv creates popup control for the drop down list and that brings me to another question. Why in the hell ComboBoxAdv creates popup container in construction. Same story but more severe one with DateTimePickerAdv - it creates !!! GRID !!! at startup, I understand that you guys use it to show calender (easily customizable one), but I believe this is poor implementation to create popup which might not be even opened in constructor.
Why not use lazy loading in both cases? Users might not even see that popup, but you guys still impose penalty at startup time of even small forms .
So main question here is: Is ComboBoxAdv leaking resources?
Regards,
Boris Kartamyshev.
ComboBoxAdvLeakTest.zip