diff options
author | mtklein <mtklein@chromium.org> | 2016-03-07 12:28:17 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-07 12:28:17 -0800 |
commit | 71aca549914c868d50cd51ddff3fb7a5bfe250cd (patch) | |
tree | 1409d9973ad64ef6aea7ec2ef2addefe0f531e6d /tests/RefCntTest.cpp | |
parent | aecc018f86d911198b7c7775cee04f61bd10b430 (diff) |
add virtual ~Effect()
Today we make an sk_sp<Effect> from an sk_sp<EffectImpl>.
But when the sk_sp<Effect> dies, it calls ~Effect(), not ~EffectImpl().
Making ~Effect() virtual fixes this.
This should make our Google3 tests sized-delete clean, unblocking those folks.
Review URL: https://codereview.chromium.org/1769093002
Diffstat (limited to 'tests/RefCntTest.cpp')
-rw-r--r-- | tests/RefCntTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/RefCntTest.cpp b/tests/RefCntTest.cpp index f5345b6a54..d3cda7f38d 100644 --- a/tests/RefCntTest.cpp +++ b/tests/RefCntTest.cpp @@ -99,6 +99,7 @@ public: Effect() : fRefCnt(1) { gNewCounter += 1; } + virtual ~Effect() {} int fRefCnt; @@ -135,6 +136,8 @@ public: }; struct EffectImpl : public Effect { + ~EffectImpl() override {} + static sk_sp<EffectImpl> Create() { return sk_sp<EffectImpl>(new EffectImpl); } |