diff options
| author | 2021-03-22 12:55:25 +0800 | |
|---|---|---|
| committer | 2021-03-22 12:59:21 +0800 | |
| commit | 2d33d70352c3e339d7abef5aa2598247e79307c9 (patch) | |
| tree | d87a986c795633dbd8b25070d179c08d5b383f19 /graphics/java/android | |
| parent | efbd8b39615a3f539798bf71aa509332bae11e27 (diff) | |
Fix thread-shared field evades lock acquisition reported by Coverity
Change-Id: Ia351e2ddc79a3f8e1b47ed1e697a2d24b2a3ebe7
Diffstat (limited to 'graphics/java/android')
| -rw-r--r-- | graphics/java/android/graphics/Typeface.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/graphics/java/android/graphics/Typeface.java b/graphics/java/android/graphics/Typeface.java index fe5c1be05927..d048efcfd12c 100644 --- a/graphics/java/android/graphics/Typeface.java +++ b/graphics/java/android/graphics/Typeface.java @@ -1196,13 +1196,11 @@ public class Typeface { /** @hide */ public boolean isSupportedAxes(int axis) { - if (mSupportedAxes == null) { - synchronized (this) { + synchronized (this) { + if (mSupportedAxes == null) { + mSupportedAxes = nativeGetSupportedAxes(native_instance); if (mSupportedAxes == null) { - mSupportedAxes = nativeGetSupportedAxes(native_instance); - if (mSupportedAxes == null) { - mSupportedAxes = EMPTY_AXES; - } + mSupportedAxes = EMPTY_AXES; } } } |