diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-08-25 06:56:09 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-08-25 10:03:03 -0700 |
| commit | c17d1cfebc016ed790df74f0eeb539a4a71fadda (patch) | |
| tree | 4b5eeee07ae35c1d25adc2bb8575c115b92f05ec /src/core/pipe.c | |
| parent | b1ece6af107958d9d3935586778184763a44f5ee (diff) | |
| download | nng-c17d1cfebc016ed790df74f0eeb539a4a71fadda.tar.gz nng-c17d1cfebc016ed790df74f0eeb539a4a71fadda.tar.bz2 nng-c17d1cfebc016ed790df74f0eeb539a4a71fadda.zip | |
fixes #2148 Old id_reg_map seems not be freed
This simplifies the code to just use a precompiled static list.
This should be lighter weight, and provably free from leaks.
Diffstat (limited to 'src/core/pipe.c')
| -rw-r--r-- | src/core/pipe.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/pipe.c b/src/core/pipe.c index 94520c39..bfc272b3 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -9,8 +9,8 @@ // found online at https://opensource.org/licenses/MIT. // -#include "core/nng_impl.h" #include "nng/nng.h" +#include "nng_impl.h" #include "sockimpl.h" #include <stdio.h> @@ -20,9 +20,8 @@ // Operations on pipes (to the transport) are generally blocking operations, // performed in the context of the protocol. -static nni_id_map pipes = - NNI_ID_MAP_INITIALIZER(1, 0x7fffffff, NNI_ID_FLAG_RANDOM); -static nni_mtx pipes_lk = NNI_MTX_INITIALIZER; +static nni_id_map pipes = NNI_ID_MAP_INITIALIZER(1, 0x7fffffff, true); +static nni_mtx pipes_lk = NNI_MTX_INITIALIZER; static void pipe_destroy(void *); static void pipe_reap(void *); |
