We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Leak in themed control

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? Thanks, Sam

8 Replies

SG Sean Greer August 23, 2004 04:40 PM UTC

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. Sean


AD Administrator Syncfusion Team August 23, 2004 04:55 PM UTC

Sean, 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? Thanks, Sam


SG Sean Greer August 23, 2004 05:27 PM UTC

Sam, 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? Sean WindowsApplication74_7285.zip


AD Administrator Syncfusion Team August 23, 2004 06:48 PM UTC

Sean, 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. http://www.syncfusion.com/products/tools/features/tools_feat_14.aspx Sam


AD Administrator Syncfusion Team August 23, 2004 06:49 PM UTC

Sean, I am sorry. I mean "We are not talking about the same control here...." in my previous post. Sam


SG Sean Greer August 23, 2004 07:19 PM UTC

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. Sean


AD Administrator Syncfusion Team August 23, 2004 07:30 PM UTC

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. Sam


AD Administrator Syncfusion Team August 24, 2004 10:28 AM UTC

Hi, 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. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon