summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-03-07 15:09:00 +0100
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-03-07 18:38:34 +0100
commitba70a8756361a0659a63a75a7c534d4442d69b23 (patch)
tree6683fdc91a6773225deaf283d27bc53d2b049901 /static
parentd98f71fb6b8b2b559bffc8d10584fe1dd7cf5843 (diff)
Fix Embind'ing of UNO Any getter for sequences
Change-Id: I5c53cb1d244731dac8f9e3f4797a7a155b9a9afa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164541 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'static')
-rw-r--r--static/source/unoembindhelpers/PrimaryBindings.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/static/source/unoembindhelpers/PrimaryBindings.cxx b/static/source/unoembindhelpers/PrimaryBindings.cxx
index 51048dc3edf4..2e5ecac00054 100644
--- a/static/source/unoembindhelpers/PrimaryBindings.cxx
+++ b/static/source/unoembindhelpers/PrimaryBindings.cxx
@@ -306,7 +306,11 @@ EMSCRIPTEN_BINDINGS(PrimaryBindings)
return emscripten::val(*o3tl::forceAccess<css::uno::Type>(self));
case css::uno::TypeClass_SEQUENCE:
{
- emscripten::internal::WireTypePack argv(const_cast<void*>(self.getValue()));
+ auto const seq = *static_cast<uno_Sequence* const*>(self.getValue());
+ auto const copy = std::malloc(sizeof(uno_Sequence*));
+ *static_cast<uno_Sequence**>(copy) = seq;
+ osl_atomic_increment(&seq->nRefCount);
+ emscripten::internal::WireTypePack argv(std::move(copy));
return emscripten::val::take_ownership(
_emval_take_value(getTypeId(self.getValueType()), argv));
}