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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GC.SuppressFinalize in PdfTrueTypeFont Dispose method

Thread ID:





98996 Apr 15,2011 08:29 AM UTC May 6,2011 12:13 PM UTC WinForms 3
Tags: PDF
Enrica EANDI
Asked On April 15, 2011 08:29 AM UTC


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?


Geetha M [Syncfusion]
Replied On 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.


Enrica EANDI
Replied On May 6, 2011 11:46 AM UTC


news about this post?

Stefano Montimoregi

Geetha M [Syncfusion]
Replied On 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.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon