summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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));
}