|
|
@ -174,8 +174,8 @@ static bool is_special(grpc_error *err) { |
|
|
|
grpc_error *grpc_error_ref(grpc_error *err, const char *file, int line, |
|
|
|
grpc_error *grpc_error_ref(grpc_error *err, const char *file, int line, |
|
|
|
const char *func) { |
|
|
|
const char *func) { |
|
|
|
if (is_special(err)) return err; |
|
|
|
if (is_special(err)) return err; |
|
|
|
gpr_log(GPR_DEBUG, "%p: %d -> %d [%s:%d %s]", err, err->refs.count, |
|
|
|
gpr_log(GPR_DEBUG, "%p: %" PRIdPTR " -> %" PRIdPTR " [%s:%d %s]", err, |
|
|
|
err->refs.count + 1, file, line, func); |
|
|
|
err->refs.count, err->refs.count + 1, file, line, func); |
|
|
|
gpr_ref(&err->refs); |
|
|
|
gpr_ref(&err->refs); |
|
|
|
return err; |
|
|
|
return err; |
|
|
|
} |
|
|
|
} |
|
|
@ -200,8 +200,8 @@ static void error_destroy(grpc_error *err) { |
|
|
|
void grpc_error_unref(grpc_error *err, const char *file, int line, |
|
|
|
void grpc_error_unref(grpc_error *err, const char *file, int line, |
|
|
|
const char *func) { |
|
|
|
const char *func) { |
|
|
|
if (is_special(err)) return; |
|
|
|
if (is_special(err)) return; |
|
|
|
gpr_log(GPR_DEBUG, "%p: %d -> %d [%s:%d %s]", err, err->refs.count, |
|
|
|
gpr_log(GPR_DEBUG, "%p: %" PRIdPTR " -> %" PRIdPTR " [%s:%d %s]", err, |
|
|
|
err->refs.count - 1, file, line, func); |
|
|
|
err->refs.count, err->refs.count - 1, file, line, func); |
|
|
|
if (gpr_unref(&err->refs)) { |
|
|
|
if (gpr_unref(&err->refs)) { |
|
|
|
error_destroy(err); |
|
|
|
error_destroy(err); |
|
|
|
} |
|
|
|
} |
|
|
|