Index: gm/colortype.cpp |
diff --git a/gm/colortype.cpp b/gm/colortype.cpp |
index 48e39d086eaca735813f7d99df7eb917b4734a4f..e49f9ecb4457f31ea2a32b63b0ebd1d56ccf0c61 100644 |
--- a/gm/colortype.cpp |
+++ b/gm/colortype.cpp |
@@ -12,7 +12,16 @@ |
class ColorTypeGM : public skiagm::GM { |
public: |
- ColorTypeGM() { |
+ ColorTypeGM() |
+ : fColorType(NULL) { |
+ } |
+ |
+ virtual ~ColorTypeGM() { |
+ SkSafeUnref(fColorType); |
+ } |
+ |
+protected: |
+ void onOnceBeforeDraw() override { |
const SkColor colors[] = { |
SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, |
SK_ColorMAGENTA, SK_ColorCYAN, SK_ColorYELLOW |
@@ -35,11 +44,6 @@ public: |
orig->unref(); |
} |
- virtual ~ColorTypeGM() { |
- fColorType->unref(); |
- } |
- |
-protected: |
SkString onShortName() override { |
return SkString("colortype"); |
} |