diff --git a/src/conn.c b/src/conn.c index 0a1a1c9e..415f00e9 100644 --- a/src/conn.c +++ b/src/conn.c @@ -4471,7 +4471,7 @@ natsConn_defaultErrHandler(natsConnection *nc, natsSubscription *sub, natsStatus int natsConn_getServices(microService ***services, natsConnection *nc) { int numServices = 0; - natsConn_Lock(nc); // or use subsMu? <>/<> TODO + natsConn_Lock(nc); *services = nc->services; numServices = nc->numServices; natsConn_Unlock(nc); diff --git a/src/micro.c b/src/micro.c index b42caada..4aa4eee1 100644 --- a/src/micro.c +++ b/src/micro.c @@ -423,7 +423,6 @@ _new_service(microService **ptr, natsConnection *nc) if (*ptr == NULL) return micro_ErrorOutOfMemory; - natsConn_retain(nc); (*ptr)->refs = 1; (*ptr)->nc = nc; (*ptr)->started = nats_Now() * 1000000; @@ -472,7 +471,6 @@ _free_service(microService *m) } _free_cloned_service_config(m->cfg); - natsConn_release(m->nc); natsMutex_Destroy(m->service_mu); NATS_FREE(m); }