diff --git a/src/aio.c b/src/aio.c index cdfb5fded..4c0eb48db 100644 --- a/src/aio.c +++ b/src/aio.c @@ -127,9 +127,6 @@ static void iaio_finalizer(SEXP xptr) { nng_aio_free(xp->aio); if (xp->data != NULL) R_Free(xp->data); - // release linked list node if cb has already run - if (xp->cb != NULL && TAG((SEXP) xp->cb) == R_NilValue) - nano_ReleaseObject((SEXP) xp->cb); R_Free(xp); } diff --git a/src/thread.c b/src/thread.c index c3fe47e77..02f599e56 100644 --- a/src/thread.c +++ b/src/thread.c @@ -236,9 +236,8 @@ static void thread_disp_finalizer(SEXP xptr) { ncv->condition = -1; nng_cv_wake(cv); nng_mtx_unlock(mtx); - if (xp->tls != NULL) { + if (xp->tls != NULL) nng_tls_config_free(xp->tls); - } nng_thread_destroy(xp->thr); nng_url_free(xp->up); for (int i = 0; i < xp->n; i++) { @@ -760,7 +759,7 @@ static void rnng_dispatch_thread(void *args) { for (R_xlen_t i = 0; i < n; i++) nng_close(sock[i]); fail: - nng_close(hsock); + nng_close(hsock); }