diff options
Diffstat (limited to 'core/jni/android/graphics/FontFamily.cpp')
-rw-r--r-- | core/jni/android/graphics/FontFamily.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/jni/android/graphics/FontFamily.cpp b/core/jni/android/graphics/FontFamily.cpp index 3e6327b..d28669a 100644 --- a/core/jni/android/graphics/FontFamily.cpp +++ b/core/jni/android/graphics/FontFamily.cpp @@ -111,7 +111,8 @@ static jboolean FontFamily_addFontFromAsset(JNIEnv* env, jobject, jlong familyPt } SkAutoTUnref<SkData> data(SkData::NewWithProc(buf, asset->getLength(), releaseAsset, asset)); - SkAutoTUnref<SkMemoryStream> stream(new SkMemoryStream(data)); + SkMemoryStream* stream = new SkMemoryStream(data); + // CreateFromStream takes ownership of stream. SkTypeface* face = SkTypeface::CreateFromStream(stream); if (face == NULL) { ALOGE("addFontFromAsset failed to create font %s", str.c_str()); |