From 713b80f440cb414cd0b856bde0ea1b31f939777f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 9 Nov 2024 23:45:21 -0800 Subject: refactor initialization/finalization Applications must now call nng_init(), but they can supply a set of parameters optionally. The code is now safe for multiple libraries to do this concurrently, meaning nng_fini no longer can race against another instance starting up. The nni_init checks on all public APIs are removed now. --- tests/cplusplus_pair.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/cplusplus_pair.cc') diff --git a/tests/cplusplus_pair.cc b/tests/cplusplus_pair.cc index 002c6f58..d011c4cd 100644 --- a/tests/cplusplus_pair.cc +++ b/tests/cplusplus_pair.cc @@ -29,6 +29,7 @@ main(int argc, char **argv) (void) argc; (void) argv; + nng_init(NULL); if ((rv = nng_pair1_open(&s1)) != 0) { throw nng_strerror(rv); } @@ -69,6 +70,7 @@ main(int argc, char **argv) } printf("Pass.\n"); + nng_fini(); #else (void) argc; (void) argv; -- cgit v1.2.3-70-g09d2