unotest/source/embindtest/embindtest.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit d64d8bd8bcb23af9e246a59ec33d6bbb3994f1be Author: Stephan Bergmann <[email protected]> AuthorDate: Thu Feb 13 16:26:38 2025 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Thu Feb 13 22:48:35 2025 +0100 Instances of salhelper::Thread must not be allocated on the stack ...as salhelper::Thread::onTerminated() calls salhelper::SimpleReferenceObject::release() calls delete this Change-Id: I3d64882dab014e270806fcc12461f816bc9d101d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181631 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/unotest/source/embindtest/embindtest.cxx b/unotest/source/embindtest/embindtest.cxx index 02a5a39c3016..1460825ecbbf 100644 --- a/unotest/source/embindtest/embindtest.cxx +++ b/unotest/source/embindtest/embindtest.cxx @@ -35,6 +35,7 @@ #include <org/libreoffice/embindtest/Template.hpp> #include <org/libreoffice/embindtest/Test.hpp> #include <org/libreoffice/embindtest/XTest.hpp> +#include <rtl/ref.hxx> #include <rtl/ustring.hxx> #include <sal/types.h> #include <salhelper/thread.hxx> @@ -930,11 +931,11 @@ class Test : public cppu::WeakImplHelper<org::libreoffice::embindtest::XTest> sal_Bool SAL_CALL testSolarMutex() override { - TestThread t; - t.launch(); - t.join(); + rtl::Reference t(new TestThread); + t->launch(); + t->join(); SolarMutexGuard g; - return t.value; + return t->value; } OUString stringAttribute_ = u"hä"_ustr;
