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

GC.SuppressFinalize in PdfTrueTypeFont Dispose method

Hi,

premise: i bought Syncfusion source code.

I've a problem with finalizing PdfTrueTypeFont objects because in the destructor method ( ~PdfTrueTypeFont() ) is called the Clear() of the static cache (PdfDocument.Cache.Clear();). Why?

The destructor of objects is called from the Garbage Collector and we don't know when it is called. Microsoft "Dispose pattern" specifies that the Dispose method must contains the GC.SuppressFinalize, so if it is called manually the object destructor it's not called later by the Garbage Collector.

The problem using the PdfTrueTypeFont is that i call manually the Dispose method (i need to call it working with isposable and generic objects) on it and later the GC call the destructor...but whe the GC call the destructor i'm creating another PDFDocument with other new Fonts and the destructor (of previous pdffont) clear the cache.

Why at the end of Dispose method of PdfTrueTypeFont is not present the GC.SuppressFinalize?


Regards,
Stefano




3 Replies

GM Geetha M Syncfusion Team April 21, 2011 11:55 AM UTC

Hi Stefano,

Thank you for your interest in Syncfusion products.

I have forwarded this query to our development team and will get back to you in two days.

Please let me know if you have any questions.

Regards,
Geetha



EE Enrica EANDI May 6, 2011 11:46 AM UTC

Hi,

news about this post?


Regards,
Stefano Montimoregi



GM Geetha M Syncfusion Team May 6, 2011 12:13 PM UTC

Hi Stefano,

Sorry for the delayed response.

We have modified the dispose pattern of PdfTrueTypeFont with v9.1. Could you please try with this version? If you are still able to reproduce the problem, please create a new direct trac incident with details.

Regards,
Geetha


Loader.
Live Chat Icon For mobile
Up arrow icon