aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-05-18 00:43:58 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-05-18 00:43:58 +0000
commit22dbaaf405e70da862a430f5e2558ce63ce17372 (patch)
tree103f96a0fb06e959bb70a2011af1021cdf125bac /src/ports
parented0bfb015a5d64b608f4168e0565689d501cbe98 (diff)
Fix reference count on openStream
Issue 62067: SkFontHost_linux.cpp: Reference counting problem git-svn-id: http://skia.googlecode.com/svn/trunk@176 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports')
-rw-r--r--src/ports/SkFontHost_linux.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ports/SkFontHost_linux.cpp b/src/ports/SkFontHost_linux.cpp
index 0c69126a26..743daa5bf2 100644
--- a/src/ports/SkFontHost_linux.cpp
+++ b/src/ports/SkFontHost_linux.cpp
@@ -260,7 +260,7 @@ public:
bool isSysFont() const { return fIsSysFont; }
FamilyRec* getFamily() const { return fFamilyRec; }
-
+ // openStream returns a SkStream that has been ref-ed
virtual SkStream* openStream() = 0;
virtual void closeStream(SkStream*) = 0;
virtual const char* getUniqueString() const = 0;
@@ -286,7 +286,12 @@ public:
}
// overrides
- virtual SkStream* openStream() { return fStream; }
+ virtual SkStream* openStream()
+ {
+ // openStream returns a refed stream.
+ fStream->ref();
+ return fStream;
+ }
virtual void closeStream(SkStream*) {}
virtual const char* getUniqueString() const { return NULL; }