summaryrefslogtreecommitdiff
path: root/codemaker
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir.extern@allotropia.de>2023-09-25 09:26:01 +0300
committerSarper Akdemir <sarper.akdemir.extern@allotropia.de>2023-09-26 08:51:50 +0200
commitda38a44b2839480cc333c18f312979d61324d6b9 (patch)
tree6750d3e406671125377c9c5437b0fd743e411298 /codemaker
parent46fe54c147b540ef8447fcfca7fe0f3723e77f53 (diff)
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.extern@allotropia.de>
Diffstat (limited to 'codemaker')
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx9
1 files 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"