[Libreoffice-commits] core.git: 2 commits - dbaccess/source framework/source
Stephan Bergmann
sbergman at redhat.com
Fri Jun 13 08:43:37 PDT 2014
dbaccess/source/shared/registrationhelper.cxx | 1 -
framework/source/inc/loadenv/loadenv.hxx | 6 +++---
framework/source/loadenv/loadenv.cxx | 13 +++++--------
3 files changed, 8 insertions(+), 12 deletions(-)
New commits:
commit da8bfce2574b0aec269004154965f44aa101a15b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Jun 12 17:20:32 2014 +0200
Fix memory leak
Change-Id: Ib0a2d8d69f5bd43872c949d79c685f71657dc9db
diff --git a/framework/source/inc/loadenv/loadenv.hxx b/framework/source/inc/loadenv/loadenv.hxx
index 355f23b..55d9a93 100644
--- a/framework/source/inc/loadenv/loadenv.hxx
+++ b/framework/source/inc/loadenv/loadenv.hxx
@@ -32,7 +32,7 @@
#include <com/sun/star/io/IOException.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/URL.hpp>
-
+#include <rtl/ref.hxx>
#include <unotools/mediadescriptor.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <cppuhelper/implbase2.hxx>
@@ -192,7 +192,7 @@ private:
*/
ActionLockGuard m_aTargetLock;
- QuietInteraction* m_pQuietInteraction;
+ rtl::Reference<QuietInteraction> m_pQuietInteraction;
public:
@@ -367,7 +367,7 @@ public:
const css::uno::Reference< css::uno::XComponentContext >& i_rxContext,
utl::MediaDescriptor& io_lMediaDescriptor,
const bool _bUIMode,
- QuietInteraction** o_ppQuiteInteraction
+ rtl::Reference<QuietInteraction>* o_ppQuiteInteraction
);
/** TODO document me ... */
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 2c02d4d..a87e618 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -132,7 +132,6 @@ LoadEnv::LoadEnv(const css::uno::Reference< css::uno::XComponentContext >& xCont
, m_bCloseFrameOnError(false)
, m_bReactivateControllerOnError(false)
, m_bLoaded( false )
- , m_pQuietInteraction( 0 )
{
}
@@ -297,7 +296,7 @@ void LoadEnv::initializeLoading(const OUString&
void LoadEnv::initializeUIDefaults( const css::uno::Reference< css::uno::XComponentContext >& i_rxContext,
utl::MediaDescriptor& io_lMediaDescriptor, const bool i_bUIMode,
- QuietInteraction** o_ppQuietInteraction )
+ rtl::Reference<QuietInteraction>* o_ppQuietInteraction )
{
css::uno::Reference< css::task::XInteractionHandler > xInteractionHandler;
sal_Int16 nMacroMode;
@@ -319,12 +318,11 @@ void LoadEnv::initializeUIDefaults( const css::uno::Reference< css::uno::XCompon
{
nMacroMode = css::document::MacroExecMode::NEVER_EXECUTE;
nUpdateMode = css::document::UpdateDocMode::NO_UPDATE;
- QuietInteraction* pQuietInteraction = new QuietInteraction();
- xInteractionHandler = css::uno::Reference< css::task::XInteractionHandler >(static_cast< css::task::XInteractionHandler* >(pQuietInteraction), css::uno::UNO_QUERY);
+ rtl::Reference<QuietInteraction> pQuietInteraction = new QuietInteraction();
+ xInteractionHandler = pQuietInteraction.get();
if ( o_ppQuietInteraction != NULL )
{
*o_ppQuietInteraction = pQuietInteraction;
- (*o_ppQuietInteraction)->acquire();
}
}
@@ -1618,11 +1616,10 @@ void LoadEnv::impl_reactForLoadingState()
css::uno::Any aRequest;
bool bThrow = false;
- if ( !m_bLoaded && m_pQuietInteraction && m_pQuietInteraction->wasUsed() )
+ if ( !m_bLoaded && m_pQuietInteraction.is() && m_pQuietInteraction->wasUsed() )
{
aRequest = m_pQuietInteraction->getRequest();
- m_pQuietInteraction->release();
- m_pQuietInteraction = 0;
+ m_pQuietInteraction.clear();
bThrow = true;
}
commit 85e6eb78c76263bd10644212b161c6c433e8096d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Jun 12 17:18:21 2014 +0200
Fix memory leak
Change-Id: Idc75fd0735452ffdf6a21e3597cd3fe74f651581
diff --git a/dbaccess/source/shared/registrationhelper.cxx b/dbaccess/source/shared/registrationhelper.cxx
index 6422411..308abb0 100644
--- a/dbaccess/source/shared/registrationhelper.cxx
+++ b/dbaccess/source/shared/registrationhelper.cxx
@@ -141,7 +141,6 @@ uno::Reference< uno::XInterface > OModuleRegistration::getComponentFactory(
xReturn = FactoryInstantiationFunction( _rxServiceManager, *pImplName, ComponentInstantiationFunction, *pServices, NULL);
if (xReturn.is())
{
- xReturn->acquire();
return xReturn.get();
}
}
More information about the Libreoffice-commits
mailing list