call derived ~ from GrIORef
authorbsalomon <bsalomon@google.com>
Wed, 8 Oct 2014 19:36:54 +0000 (12:36 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 8 Oct 2014 19:36:54 +0000 (12:36 -0700)
TBR=mtklein@google.com
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/641813002

include/gpu/GrGpuResource.h

index 666ab0d3b65ec8de0ce90063ce75e32a30099451..00a503510712e74901e3455dd69b3c7c138d5700 100644 (file)
@@ -103,7 +103,8 @@ private:
     void didUnref() const {
         if (0 == fPendingReads && 0 == fPendingWrites) {
             if (0 == fRefCnt) {
-                SkDELETE(this);
+                // Must call derived destructor since this is not a virtual class.
+                SkDELETE(static_cast<const DERIVED*>(this));
             } else if (1 == fRefCnt) {
                 // The one ref is the cache's
                 static_cast<const DERIVED*>(this)->notifyIsPurgable();