From 789d346675f788ce3bfd091bcc96b2ff7ca588de Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 15 Sep 2014 14:58:32 +0100 Subject: Resolves: fdo#81635 crash after 3rd call to ApplicationScriptLibraryContainer in PackageImpl::processPackage_ xComponentContext->getServiceManager()->createInstanceWithContext( "com.sun.star.script.ApplicationScriptLibraryContainer" does not increment the refcount, so on leaving the method the refcount is decremented by 1, because on the first enter the refcount happens to be three, then if the extension has more than 3 items in it the refcount hits 0 here and falls over some of fdo#79301, fdo#70607, fdo#66706 might be dups of this regression from 306efefe22e02248eff14f8be2cef68d75d26e55 I believe (cherry picked from commit 9128507579246b1559b0bc195d7e9f89541cbbbf) Conflicts: sfx2/source/appl/appbaslib.cxx Change-Id: I3da50693fe656b68c5555b641d9b32246c8fc208 Reviewed-on: https://gerrit.libreoffice.org/11457 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- sfx2/source/appl/appbaslib.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx index d22dc48030d4..4e0c938de355 100644 --- a/sfx2/source/appl/appbaslib.cxx +++ b/sfx2/source/appl/appbaslib.cxx @@ -152,28 +152,28 @@ bool SfxBasicManagerHolder::LegacyPsswdBinaryLimitExceeded( Sequence< OUString > return true; } - // Service for application library container - extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_sfx2_ApplicationDialogLibraryContainer_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { SFX_APP()->GetBasicManager(); - return SFX_APP()->GetDialogContainer(); + css::uno::XInterface* pRet = SFX_APP()->GetDialogContainer(); + pRet->acquire(); + return pRet; } - // Service for application library container - extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_sfx2_ApplicationScriptLibraryContainer_get_implementation( css::uno::XComponentContext *, css::uno::Sequence const &) { SFX_APP()->GetBasicManager(); - return SFX_APP()->GetBasicContainer(); + css::uno::XInterface* pRet = SFX_APP()->GetBasicContainer(); + pRet->acquire(); + return pRet; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit