fix leak in Deserialize
git-svn-id: http://skia.googlecode.com/svn/trunk@112 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
fb12c3e6ba
commit
62533ed6bb
@ -106,8 +106,16 @@ public:
|
||||
*/
|
||||
static SkTypeface* CreateFromStream(SkStream* stream);
|
||||
|
||||
// Serialization
|
||||
/** Write a unique signature to a stream, sufficient to reconstruct a
|
||||
typeface referencing the same font when Deserialize is called.
|
||||
*/
|
||||
void serialize(SkWStream*) const;
|
||||
|
||||
/** Given the data previously written by serialize(), return a new instance
|
||||
to a typeface referring to the same font. If that font is not available,
|
||||
return null. If an instance is returned, the caller is responsible for
|
||||
calling unref() when they are done with it.
|
||||
*/
|
||||
static SkTypeface* Deserialize(SkStream*);
|
||||
|
||||
protected:
|
||||
|
@ -50,9 +50,7 @@ void SkTypeface::serialize(SkWStream* stream) const {
|
||||
}
|
||||
|
||||
SkTypeface* SkTypeface::Deserialize(SkStream* stream) {
|
||||
SkTypeface* face = SkFontHost::Deserialize(stream);
|
||||
face->ref();
|
||||
return face;
|
||||
return SkFontHost::Deserialize(stream);
|
||||
}
|
||||
|
||||
|
||||
|
@ -535,7 +535,7 @@ SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return SkFontHost::CreateTypeface(NULL, NULL, (SkTypeface::Style)style);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user