Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: tests/FontHostStreamTest.cpp

Issue 14907005: Check whether font creation is failed to avoid segment fault. (Closed) Base URL: http://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/FontHostStreamTest.cpp
diff --git a/tests/FontHostStreamTest.cpp b/tests/FontHostStreamTest.cpp
index 4fd88cc4da9a3ee57d6a07e62da9d665971b5975..30e469b4105b71857214e5dfc59620420b76027f 100644
--- a/tests/FontHostStreamTest.cpp
+++ b/tests/FontHostStreamTest.cpp
@@ -72,7 +72,9 @@ static void test_fontHostStream(skiatest::Reporter* reporter) {
paint.setColor(SK_ColorGRAY);
paint.setTextSize(SkIntToScalar(30));
- paint.setTypeface(SkTypeface::CreateFromName("Georgia", SkTypeface::kNormal))->unref();
+ SkTypeface* fTypeface = SkTypeface::CreateFromName("Georgia",
+ SkTypeface::kNormal);
+ SkSafeUnref(paint.setTypeface(fTypeface));
SkIRect origRect = SkIRect::MakeWH(64, 64);
SkBitmap origBitmap;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698