Skip to content

Commit

Permalink
clean valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Nov 13, 2024
1 parent edf4121 commit 089c87f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: nanonext
Type: Package
Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library
Version: 1.3.0.9011
Version: 1.3.0.9012
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
a socket library implementing 'Scalability Protocols', a reliable,
high-performance standard for common communications patterns including
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nanonext 1.3.0.9011 (development)
# nanonext 1.3.0.9012 (development)

#### Updates

Expand Down
10 changes: 5 additions & 5 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ void (*eln2)(void (*)(void *), void *, double, int) = NULL;

uint8_t special_bit = 0;

extern nng_thread *nano_wait_thr;
extern nng_aio *nano_shared_aio;
extern nng_mtx *nano_wait_mtx;
extern nng_cv *nano_wait_cv;
extern int nano_wait_condition;
nng_mtx *nano_wait_mtx;
nng_cv *nano_wait_cv;
nng_thread *nano_wait_thr = NULL;
nng_aio *nano_shared_aio = NULL;
int nano_wait_condition = 0;

SEXP nano_AioSymbol;
SEXP nano_ContextSymbol;
Expand Down
13 changes: 6 additions & 7 deletions src/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

// threads callable and messenger ----------------------------------------------

nng_mtx *nano_wait_mtx = NULL;
nng_cv *nano_wait_cv = NULL;
nng_thread *nano_wait_thr = NULL;
nng_aio *nano_shared_aio = NULL;
int nano_wait_condition = 0;
extern nng_thread *nano_wait_thr;
extern nng_aio *nano_shared_aio;
extern nng_mtx *nano_wait_mtx;
extern nng_cv *nano_wait_cv;
extern int nano_wait_condition;

// # nocov start
// tested interactively
Expand Down Expand Up @@ -462,7 +462,7 @@ SEXP rnng_wait_thread_create(SEXP x) {
}

SEXP rnng_thread_shutdown(void) {
if (nano_wait_thr) {
if (nano_wait_thr != NULL) {
if (nano_shared_aio != NULL)
nng_aio_stop(nano_shared_aio);
nng_mtx_lock(nano_wait_mtx);
Expand All @@ -472,7 +472,6 @@ SEXP rnng_thread_shutdown(void) {
nng_thread_destroy(nano_wait_thr);
nng_cv_free(nano_wait_cv);
nng_mtx_free(nano_wait_mtx);
nano_wait_thr = NULL;
}
return R_NilValue;
}
Expand Down

0 comments on commit 089c87f

Please sign in to comment.