diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-01-21 10:51:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-01-21 10:51:30 +0000 |
commit | c250178c0406f903b5816983ccd6fb91411ee9df (patch) | |
tree | 23d0ed68e39548c53582efaec46cfb941eaa3ce6 /framework/source/uiconfiguration | |
parent | d23b5e5e0cdb9cd6f981c0949e27230b8297231e (diff) |
break ownership cycle
Diffstat (limited to 'framework/source/uiconfiguration')
-rw-r--r-- | framework/source/uiconfiguration/uicategorydescription.cxx | 10 | ||||
-rw-r--r-- | framework/source/uiconfiguration/windowstateconfiguration.cxx | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/framework/source/uiconfiguration/uicategorydescription.cxx b/framework/source/uiconfiguration/uicategorydescription.cxx index b5081693fa7d..ec60d680475f 100644 --- a/framework/source/uiconfiguration/uicategorydescription.cxx +++ b/framework/source/uiconfiguration/uicategorydescription.cxx @@ -39,6 +39,8 @@ #include "properties.h" +#include "helper/mischelper.hxx" + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -148,6 +150,7 @@ class ConfigurationAccess_UICategory : // Order is neccessary for right initiali Reference< XMultiServiceFactory > m_xServiceManager; Reference< XMultiServiceFactory > m_xConfigProvider; Reference< XNameAccess > m_xConfigAccess; + Reference< XContainerListener > m_xConfigListener; sal_Bool m_bConfigAccessInitialized; sal_Bool m_bCacheFilled; IdToInfoCache m_aIdCache; @@ -180,7 +183,7 @@ ConfigurationAccess_UICategory::~ConfigurationAccess_UICategory() ResetableGuard aLock( m_aLock ); Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY ); if ( xContainer.is() ) - xContainer->removeContainerListener( this ); + xContainer->removeContainerListener(m_xConfigListener); } // XNameAccess @@ -387,7 +390,10 @@ sal_Bool ConfigurationAccess_UICategory::initializeConfigAccess() // Add as container listener Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY ); if ( xContainer.is() ) - xContainer->addContainerListener( this ); + { + m_xConfigListener = new WeakContainerListener(this); + xContainer->addContainerListener(m_xConfigListener); + } } return sal_True; diff --git a/framework/source/uiconfiguration/windowstateconfiguration.cxx b/framework/source/uiconfiguration/windowstateconfiguration.cxx index 249c833c0f90..8936f88ce9f6 100644 --- a/framework/source/uiconfiguration/windowstateconfiguration.cxx +++ b/framework/source/uiconfiguration/windowstateconfiguration.cxx @@ -36,6 +36,8 @@ #include <threadhelp/resetableguard.hxx> #include "services.h" +#include "helper/mischelper.hxx" + //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ @@ -264,6 +266,7 @@ class ConfigurationAccess_WindowState : // interfaces Reference< XMultiServiceFactory > m_xServiceManager; Reference< XMultiServiceFactory > m_xConfigProvider; Reference< XNameAccess > m_xConfigAccess; + Reference< XContainerListener > m_xConfigListener; ResourceURLToInfoCache m_aResourceURLToInfoCache; sal_Bool m_bConfigAccessInitialized : 1, m_bModified : 1; @@ -321,7 +324,7 @@ ConfigurationAccess_WindowState::~ConfigurationAccess_WindowState() ResetableGuard aLock( m_aLock ); Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY ); if ( xContainer.is() ) - xContainer->removeContainerListener( this ); + xContainer->removeContainerListener(m_xConfigListener); } // XNameAccess @@ -1324,7 +1327,10 @@ sal_Bool ConfigurationAccess_WindowState::impl_initializeConfigAccess() // Add as container listener Reference< XContainer > xContainer( m_xConfigAccess, UNO_QUERY ); if ( xContainer.is() ) - xContainer->addContainerListener( this ); + { + m_xConfigListener = new WeakContainerListener(this); + xContainer->addContainerListener(m_xConfigListener); + } } return sal_True; |