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
diff --git a/tests/RefCntTest.cpp b/tests/RefCntTest.cpp
index f5345b6..d3cda7f 100644
--- a/tests/RefCntTest.cpp
+++ b/tests/RefCntTest.cpp
@@ -99,6 +99,7 @@
Effect() : fRefCnt(1) {
gNewCounter += 1;
}
+ virtual ~Effect() {}
int fRefCnt;
@@ -135,6 +136,8 @@
};
struct EffectImpl : public Effect {
+ ~EffectImpl() override {}
+
static sk_sp<EffectImpl> Create() {
return sk_sp<EffectImpl>(new EffectImpl);
}