codemaker/source/cppumaker/cpputype.cxx |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit da38a44b2839480cc333c18f312979d61324d6b9
Author:     Sarper Akdemir <sarper.akdemir.ext...@allotropia.de>
AuthorDate: Mon Sep 25 09:26:01 2023 +0300
Commit:     Sarper Akdemir <sarper.akdemir.ext...@allotropia.de>
CommitDate: Tue Sep 26 08:51:50 2023 +0200

    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 <sarper.akdemir.ext...@allotropia.de>

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"

Reply via email to