From da38a44b2839480cc333c18f312979d61324d6b9 Mon Sep 17 00:00:00 2001 From: Sarper Akdemir Date: Mon, 25 Sep 2023 09:26:01 +0300 Subject: WASM: Embind: get rid of redundant EMSCRIPTEN conditional As suggested by Stephan Bergmann in https://gerrit.libreoffice.org/c/core/+/156273/comments/4087f8b8_8ab9a1bc It appears whole thing was redundant since the template specialization of emscripten::internal::raw_destructor in codemaker/source/cppumaker/cpputype.cxx:1228. Likely this bit causes memory leaks when the API is used and it is a temporary workaround. Change-Id: Ifb015754f16ddff1065b3285268acf8a339f975b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157234 Tested-by: Jenkins Reviewed-by: Sarper Akdemir --- codemaker/source/cppumaker/cpputype.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 124f323630bf..47b3d8f488a5 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -1208,23 +1208,20 @@ void InterfaceType::dumpDeclaration(FileStream & out) << ("static inline ::css::uno::Type const & SAL_CALL" " static_type(void * = 0);\n\n"); dec(); -#ifdef EMSCRIPTEN - out << "#ifndef EMSCRIPTEN\n"; -#endif out << "protected:\n"; inc(); out << indent() << "~" << id_ << ("() SAL_NOEXCEPT {} // avoid warnings about virtual members and" " non-virtual dtor\n"); -#ifdef EMSCRIPTEN - out << "#endif\n"; -#endif dec(); out << "};\n\n"; } void InterfaceType::dumpEmbindDeclaration(FileStream & out) { + // TODO: This is a temporary workaround that likely causes the Embind UNO + // bindings to leak memory. Reference counting and cloning mechanisms of + // Embind should be investigated to figure out what exactly we need here. out << "namespace emscripten { namespace internal { \n" "template<> void raw_destructor<" << codemaker::cpp::scopedCppName(u2b(name_)) << ">(" << codemaker::cpp::scopedCppName(u2b(name_)) << "*){}\n" -- cgit