From 14b5681ab935e957d9fea8dbd85d22496dbde10e Mon Sep 17 00:00:00 2001 From: Charlie Gao <53399081+shikokuchuo@users.noreply.github.com> Date: Tue, 30 Sep 2025 09:51:03 +0100 Subject: [PATCH] Revert "Revert resetting the R interrupts state (#199)" This reverts commit d509a3ea0e2a8d8eae946d81aad803673095dd0d. --- DESCRIPTION | 2 +- src/aio.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7c69e27e3..07a3ad2e0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: nanonext Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library -Version: 1.7.0.9004 +Version: 1.7.0.9003 Authors@R: c( person("Charlie", "Gao", , "charlie.gao@posit.co", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-0750-061X")), diff --git a/src/aio.c b/src/aio.c index 6d8d603e0..fb83d225f 100644 --- a/src/aio.c +++ b/src/aio.c @@ -456,6 +456,13 @@ SEXP rnng_aio_stop(SEXP x) { if (NANO_PTR_CHECK(coreaio, nano_AioSymbol)) break; nano_aio *aiop = (nano_aio *) NANO_PTR(coreaio); nng_aio_stop(aiop->aio); + // See #194, this is to reset the R interrupts state after an interrupt + // requested by `stop_request()` has already triggered +#ifdef _WIN32 + UserBreak = 0; +#else + R_interrupts_pending = 0; +#endif break; case VECSXP: ; const R_xlen_t xlen = Rf_xlength(x);