This fixes a potential race condition in SkTypefaceCache since the static methods which return SkTypeface ...
12 years, 10 months ago
(2012-02-15 19:21:31 UTC)
#1
This fixes a potential race condition in SkTypefaceCache since the static
methods which return SkTypeface pointers are returning them without ref()ing
them. Internally they are protected by a mutex, but externally they are not.
Note that this does not fix any implementations of SkFontHost::ValidFontID,
since http://codereview.appspot.com/5654055/ will remove it.
The alternative approach of allowing access to the mutex was investigated. The
increased complexity (and the potential for future developers to forget to
obtain the mutex) did not appear to be worth the cost, since all operations
which needed to be fast must ref the SkTypeface anyway.
Issue 5656066: Fix TypefaceCache race.
(Closed)
Created 12 years, 10 months ago by bungeman
Modified 12 years, 10 months ago
Reviewers: reed1
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 8