From 6a9bd051c439ef66cf00795b3829ca3ceece0497 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 3 Jan 2021 10:58:38 -0800 Subject: fixes #1401 valgrind reports leaks in all tests This arranges for nng_fini to be called via atexit in the test version of the library. It also cleans up some of the actual tests to reduce extraneous (and in some cases incorrect) calls to nng_fini. --- tests/httpserver.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'tests/httpserver.c') diff --git a/tests/httpserver.c b/tests/httpserver.c index a509638e..445aad0e 100644 --- a/tests/httpserver.c +++ b/tests/httpserver.c @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. +// Copyright 2021 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // Copyright 2020 Dirac Research // @@ -30,12 +30,6 @@ const char *doc2 = "This is a text file."; const char *doc3 = "This is doc number 3."; const char *doc4 = "Whoops, Errored!"; -void -cleanup(void) -{ - nng_fini(); -} - static int httpdo(nng_url *url, nng_http_req *req, nng_http_res *res, void **datap, size_t *sizep) @@ -190,7 +184,6 @@ TestMain("HTTP Server", { nng_http_handler *h; nni_init(); - atexit(cleanup); Convey("We can start an HTTP server", { nng_aio *aio; -- cgit v1.2.3-70-g09d2