From edfe8adcec43241ad052c7c82b44e14bd443323b Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 18 Apr 2024 14:29:28 +0200 Subject: Embind: call decrementExceptionRefcount upon catching The note at is a bit vague whether decrementExceptionRefcount would only be needed for Wasm-based (-fwasm-exceptions) exceptions, or also for the JS-based (-fexceptions) ones that we currently use. (But it does state clearly that for the latter we need to manually call incrementExceptionRefcount first.) Change-Id: I7714935607c990385f68730d02e367e70fa0ea03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166250 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- unotest/source/embindtest/embindtest.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'unotest') diff --git a/unotest/source/embindtest/embindtest.js b/unotest/source/embindtest/embindtest.js index 8da18fbb7d96..08bded0c81f8 100644 --- a/unotest/source/embindtest/embindtest.js +++ b/unotest/source/embindtest/embindtest.js @@ -540,9 +540,14 @@ Module.addOnPostRun(function() { try { test.throwRuntimeException(); } catch (e) { + incrementExceptionRefcount(e); + //TODO, needed when building with JS-based -fexceptions, see + // "[EH] Fix inconsistency + // of refcounting in Emscripten EH vs. Wasm EH" console.assert(e.name === 'com::sun::star::uno::RuntimeException'); console.assert(e.message === undefined); //TODO //TODO: console.assert(e.Message.startsWith('test')); + decrementExceptionRefcount(e); } const obj = { implRefcount: 0, -- cgit