When using DateTimePickerExt and TabControlExt, I can see the ThemedDrawing and ThemedComboBoxDrawing being registered through ThemedControlDrawing into XPThemes by using XPThemes.RegisterControlDrawing method. However, I wonder if XPThemes.UnregisterControlDrawing method is ever called, because I can see instances ThemedDrawing and ThemedComboBoxDrawing still hanging around in the heap and just keep adding up when the form is opened and closed.
It happens on a form that will be opened and closed for tens of times by the user during one session, so this unreleased memory has become a problem.
What is the easiest way to tell XPThemes to release the objects?
Can you repro this with a small sample? I thought I saw a problem with the DateTimePickerAdv as well, but when I attempted to create a small sample I could not repro it.
I have found other items that are interesting: if you remove a tab page from the TabControlAdv and do not dispose it, your form will stick around in memory. I''d guess that this is true for any control that is bound and has eventhandlers registered.
Personally, I think Microsoft should include a tool comparable to SciTech''s memory profiler with VS. I was shocked at the number of instances in which a non-disposed control was preventing collection of a large form.
ADAdministrator Syncfusion Team August 23, 2004 11:55 AM
Thanks for the reply. I am using SciTech Profiler to see those instance and it is a very useful tool.
The test app should be very easy to create. This will become a very long email if I attach the code. However, it is very simple to reproduce:
Form1 has one button that will launch Form2. Form1 is the Startup Form.
Form2 has DateTimePickerExt and TabControlExt with couple of TabPageExt in it.
Compile the project and Use SciTech MF to launch it. When Form1 is shown, take a heap snapshot. Then click on the button in Form1 to launch Form2. Close Form2 and take another heap snapshot.
Look at how many new instances of ThemedTabDrawing, ThemedComboboxDrawing, etc that remains undisposed and held by XPThemes. Whenever you launch Form2, you can see the instance added.
Can we use XPThemes.UnregisterControlDrawing method to unregister those ThemedDrawing objects and how can we get the instance of those objects to pass into the method?
SGSean GreerAugust 23, 2004 12:27 PM
I used the attached test app and could not repro the issue. Form1 opens Form2 which has a TabControlAdv with 4 tab pages. There are 2 DateTimePickerAdvs and all controls have themes enabled. I''m not seeing the lingering objects in memory.
Can you post the code (zipped) that you''re using?
ADAdministrator Syncfusion Team August 23, 2004 01:48 PM
Looks like we are talking about the same control here. I am using TabControlExt and DateTimePickerExt, not the Adv ones. I am nore sure if I have the Adv ones.
What are the difference? Even the description in your webpage is confusing. The title says DateTimePickerAdv, but the content keeps refering to DateTimePickerExt.
ADAdministrator Syncfusion Team August 23, 2004 01:49 PM
I am sorry. I mean "We are not talking about the same control here...." in my previous post.
SGSean GreerAugust 23, 2004 02:19 PM
Sorry Sam, I should make it clear that I am not a Syncfusion employee, just a consumer of their products. I''m particulary interested in these memory issues because I''ve spent quite a bit of time tracking them down in my app after client reported problems.
There is no difference between the DateTimePickerAdv and DateTimePickerExt. The control used to be called DateTimePickerExt but has been renamed to conform to the naming standards of the Essential Suite.
ADAdministrator Syncfusion Team August 23, 2004 02:30 PM
I am sorry. I thought you work for Syncfusion. :) My bad.
So, you are saying that I should be using the Adv, instead of Ext ones?
Thanks very much for all your help.
ADAdministrator Syncfusion Team August 24, 2004 05:28 AM
Thanks a lot for your updates, Sean.
The TabControlAdv and DateTimePickerAdv controls in v2.0 are basically the same controls as TabControlExt and DateTimePickerExt in v1.6. Their names were changed according to v2.0 naming conventions. We have made several memory leak related fixes in our v2.0 releases, and we recommend you to test for this issue using our latest release. Please create an incident in Direct-Trac in this regard, and I will update you with the download instructions for our latest release. We appreciate your cooperation, and thanks for your interest in Syncfusion products.