[webkit-reviews] review requested: [Bug 24592] [GTK] Crash in FcPatternHash : [Attachment 28653] gtkfonts.patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 16 11:56:31 PDT 2009

Xan Lopez <xan.lopez at gmail.com> has asked  for review:
Bug 24592: [GTK] Crash in FcPatternHash

Attachment 28653: gtkfonts.patch

------- Additional Comments from Xan Lopez <xan.lopez at gmail.com>
This patch makes FontPlatformDataGtk free the memory it allocates in its own
destructor, instead of having SimpleFontDataGtk free it in platformDestroy.
Also, since the class has reference counted members we need a copy constructor
and '=' operator to properly track those references when assigning and copying
objects. With these two changes I can't reproduce the crash anymore.

Holger said he was concerned this might be a performance regression, but: other
ports have objects that they also have to copy in their FontPlatformData*
classes, so I don't see how this is that different. Besides, what this does is
to add two extra refcounts per copy, it does not do actual copies of the fc
pattern or the cairo fonts. That being said, there might be better ways to
handle this, so I'm totally open to comments :)

More information about the webkit-reviews mailing list