aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/gprpp
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2018-04-20 10:44:17 -0700
committerGravatar Mark D. Roth <roth@google.com>2018-04-20 10:44:17 -0700
commit9635a04fed00cc1e9b72954cb3f72417b7f10e15 (patch)
tree0951982aa11a62c833384d36c15fe23dd346c879 /src/core/lib/gprpp
parenta1459aa6ce2a11f8d11a067cb6c86e6af84ffd71 (diff)
Work-around for ref-counted subclass deletion address problem.
Diffstat (limited to 'src/core/lib/gprpp')
-rw-r--r--src/core/lib/gprpp/orphanable.h4
-rw-r--r--src/core/lib/gprpp/ref_counted.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/core/lib/gprpp/orphanable.h b/src/core/lib/gprpp/orphanable.h
index a5bc8d8efc..b50f8c247c 100644
--- a/src/core/lib/gprpp/orphanable.h
+++ b/src/core/lib/gprpp/orphanable.h
@@ -100,7 +100,7 @@ class InternallyRefCounted : public Orphanable {
void Unref() {
if (gpr_unref(&refs_)) {
- Delete(this);
+ Delete(static_cast<Child*>(this));
}
}
@@ -173,7 +173,7 @@ class InternallyRefCountedWithTracing : public Orphanable {
void Unref() {
if (gpr_unref(&refs_)) {
- Delete(this);
+ Delete(static_cast<Child*>(this));
}
}
diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h
index 46bfaf7fb8..bd6874f3db 100644
--- a/src/core/lib/gprpp/ref_counted.h
+++ b/src/core/lib/gprpp/ref_counted.h
@@ -54,7 +54,7 @@ class RefCounted {
// friend of this class.
void Unref() {
if (gpr_unref(&refs_)) {
- Delete(this);
+ Delete(static_cast<Child*>(this));
}
}
@@ -114,7 +114,7 @@ class RefCountedWithTracing {
void Unref() {
if (gpr_unref(&refs_)) {
- Delete(this);
+ Delete(static_cast<Child*>(this));
}
}