Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: include/gpu/GrGpuResource.h

Issue 641813002: call derived ~ from GrIORef (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrGpuResource.h
diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h
index 666ab0d3b65ec8de0ce90063ce75e32a30099451..00a503510712e74901e3455dd69b3c7c138d5700 100644
--- a/include/gpu/GrGpuResource.h
+++ b/include/gpu/GrGpuResource.h
@@ -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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698