static/source/embindmaker/embindmaker.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 038c1983122ada4cfe0c85b527940a410643ace1
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Fri Apr 19 15:06:03 2024 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Fri Apr 19 21:38:50 2024 +0200

    Embind: Clarify need for emscripten::internal::raw_destructor 
specializations
    
    ...which are needed at compile time (the emscripten::class_<T> ctor always
    records the address of emscripten::internal::raw_destructor<T>, even in 
cases
    where it never calls it; and raw_destructor internally calls delete, but the
    dtor of the UNO interface types is protected) but not at runtime (as those 
UNO
    interface types are only accessed through css::uno::Reference smart 
pointers)
    
    Change-Id: I09e4f258f8dfc0fc53c0fe7210c7f709d86be176
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166304
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/static/source/embindmaker/embindmaker.cxx 
b/static/source/embindmaker/embindmaker.cxx
index abce7e574f67..f9540c1f006b 100644
--- a/static/source/embindmaker/embindmaker.cxx
+++ b/static/source/embindmaker/embindmaker.cxx
@@ -951,6 +951,7 @@ SAL_IMPLEMENT_MAIN()
         cppOut << "#include <emscripten/bind.h>
"
                   "#include <com/sun/star/uno/Any.hxx>
"
                   "#include <com/sun/star/uno/Reference.hxx>
"
+                  "#include <o3tl/unreachable.hxx>
"
                   "#include <static/unoembindhelpers/PrimaryBindings.hxx>
";
         for (auto const& enm : enums)
         {
@@ -977,14 +978,11 @@ SAL_IMPLEMENT_MAIN()
             cppOut << "#include <" << sng.replace('.', '/') << ".hpp>
";
         }
         cppOut << "
"
-                  "// 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:
"
                   "namespace emscripten::internal {
";
         for (auto const& ifc : interfaces)
         {
             cppOut << "    template<> void raw_destructor<" << cppName(ifc) << 
">(" << cppName(ifc)
-                   << " *) {}
";
+                   << " *) { O3TL_UNREACHABLE; }
";
         }
         cppOut << "}

";
         unsigned long long n = 0;

Reply via email to