diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-17 23:37:38 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-17 23:37:38 +0000 |
commit | b09bfcb7b1c755c996ed76bba377201048e454af (patch) | |
tree | e5d4b5393d042ec578ae17db158f3bdddb872f2d /experimental/SkiaExamples | |
parent | 658e1b38b94fd3b31edcafe1aa226ca7da9b80d2 (diff) |
add virtual destructor for SkExample to fix build error.
The original SkExample have virtual function draw(), but have no virtual destructor. This may lead to memory leak when free the instance of derived class of SkExample. The latest skia code show error when build SkiaExamples by "ninja -C out/Release SkiaExamples":
error: ‘class SkExample’ has virtual functions and accessible non-virtual destructor.
R=caryclark@google.com
Author: yunchao.he@intel.com
Review URL: https://codereview.chromium.org/98463013
git-svn-id: http://skia.googlecode.com/svn/trunk@12728 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental/SkiaExamples')
-rw-r--r-- | experimental/SkiaExamples/SkExample.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/experimental/SkiaExamples/SkExample.h b/experimental/SkiaExamples/SkExample.h index bea3aec4fc..4b84723ac2 100644 --- a/experimental/SkiaExamples/SkExample.h +++ b/experimental/SkiaExamples/SkExample.h @@ -23,6 +23,8 @@ class SkExample : public SkNoncopyable { public: SkExample(SkExampleWindow* window) : fWindow(window) {} + virtual ~SkExample() {} + // Your class should override this method to do its thing. virtual void draw(SkCanvas* canvas) = 0; |