Work-around for ref-counted subclass deletion address problem.

reviewable/pr14886/r1
Mark D. Roth 7 years ago
parent 7f25d201c3
commit d536dba4d3
  1. 4
      src/core/ext/filters/client_channel/lb_policy.h
  2. 4
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
  3. 4
      src/core/ext/filters/client_channel/method_params.h
  4. 4
      src/core/ext/filters/client_channel/resolver.h
  5. 4
      src/core/ext/filters/client_channel/retry_throttle.h
  6. 4
      src/core/lib/gprpp/orphanable.h
  7. 4
      src/core/lib/gprpp/ref_counted.h
  8. 4
      src/core/lib/slice/slice_hash_table.h
  9. 4
      src/core/tsi/ssl/session_cache/ssl_session_cache.h

@ -162,6 +162,10 @@ class LoadBalancingPolicy
GRPC_ABSTRACT_BASE_CLASS
protected:
// So Delete() can access our protected dtor.
template <typename T>
friend void Delete(T*);
explicit LoadBalancingPolicy(const Args& args);
virtual ~LoadBalancingPolicy();

@ -189,6 +189,10 @@ class GrpcLb : public LoadBalancingPolicy {
bool seen_initial_response() const { return seen_initial_response_; }
private:
// So Delete() can access our private dtor.
template <typename T>
friend void grpc_core::Delete(T*);
~BalancerCallState();
GrpcLb* grpclb_policy() const {

@ -60,6 +60,10 @@ class ClientChannelMethodParams : public RefCounted<ClientChannelMethodParams> {
template <typename T, typename... Args>
friend T* grpc_core::New(Args&&... args);
// So Delete() can call our private dtor.
template <typename T>
friend void grpc_core::Delete(T*);
ClientChannelMethodParams() {}
virtual ~ClientChannelMethodParams() {}

@ -105,6 +105,10 @@ class Resolver : public InternallyRefCountedWithTracing<Resolver> {
GRPC_ABSTRACT_BASE_CLASS
protected:
// So Delete() can access our protected dtor.
template <typename T>
friend void Delete(T*);
/// Does NOT take ownership of the reference to \a combiner.
// TODO(roth): Once we have a C++-like interface for combiners, this
// API should change to take a RefCountedPtr<>, so that we always take

@ -42,6 +42,10 @@ class ServerRetryThrottleData : public RefCounted<ServerRetryThrottleData> {
intptr_t milli_token_ratio() const { return milli_token_ratio_; }
private:
// So Delete() can call our private dtor.
template <typename T>
friend void grpc_core::Delete(T*);
~ServerRetryThrottleData();
void GetReplacementThrottleDataIfNeeded(

@ -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));
}
}

@ -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));
}
}

@ -81,6 +81,10 @@ class SliceHashTable : public RefCounted<SliceHashTable<T>> {
template <typename T2, typename... Args>
friend T2* New(Args&&... args);
// So Delete() can call our private dtor.
template <typename T2>
friend void Delete(T2*);
SliceHashTable(size_t num_entries, Entry* entries, ValueCmp value_cmp);
virtual ~SliceHashTable();

@ -69,6 +69,10 @@ class SslSessionLRUCache : public grpc_core::RefCounted<SslSessionLRUCache> {
template <typename T, typename... Args>
friend T* grpc_core::New(Args&&... args);
// So Delete() can call our private dtor.
template <typename T>
friend void grpc_core::Delete(T*);
class Node;
explicit SslSessionLRUCache(size_t capacity);

Loading…
Cancel
Save