Utility functions for reference counting.

This commit is contained in:
Ian Gulliver
2016-03-02 19:20:25 -08:00
parent 20bc50795d
commit 14be11de79
6 changed files with 19 additions and 8 deletions

View File

@@ -142,7 +142,7 @@ static void outgoing_resolve_wrapper(struct peer *peer) {
}
static void outgoing_del(struct outgoing *outgoing) {
(*outgoing->flow->ref_count)--;
flow_ref_dec(outgoing->flow);
if (outgoing->peer.fd >= 0) {
assert(!close(outgoing->peer.fd));
}
@@ -160,7 +160,7 @@ void outgoing_cleanup() {
}
void outgoing_new(char *node, char *service, struct flow *flow, void *passthrough) {
(*flow->ref_count)++;
flow_ref_inc(flow);
struct outgoing *outgoing = malloc(sizeof(*outgoing));
uuid_gen(outgoing->id);