summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-06-21 14:47:21 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-06-21 14:47:21 +0200
commite3067d7a280a6f75ce3cc550f3159eb8bb19ba94 (patch)
treef34efce1622f090c0a715356ecf1cdddd1424ce2 /sc/source
parenta157711cab1d59951b46b2c2462f0bad4e500a66 (diff)
unoawt2: if the DataPilotSource supports XComponent, dispose it, so it can free its resources
Diffstat (limited to 'sc/source')
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/dpobject.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index fd4289737..97351c7e7 100755..100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -73,6 +73,7 @@
#include <comphelper/processfactory.hxx>
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <svl/zforlist.hxx> // IsNumberFormat
#include <vector>
@@ -85,6 +86,8 @@ using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::Any;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::lang::XComponent;
using ::com::sun::star::sheet::DataPilotTableHeaderData;
using ::com::sun::star::sheet::DataPilotTablePositionData;
using ::com::sun::star::beans::XPropertySet;
@@ -215,6 +218,7 @@ ScDPObject::~ScDPObject()
delete pImpDesc;
delete pServDesc;
mnCacheId = -1; // Wang Xu Ming - DataPilot migration
+ InvalidateSource();
}
ScDataObject* ScDPObject::Clone() const
@@ -530,6 +534,18 @@ void ScDPObject::InvalidateData()
void ScDPObject::InvalidateSource()
{
+ Reference< XComponent > xObjectComp( xSource, UNO_QUERY );
+ if ( xObjectComp.is() )
+ {
+ try
+ {
+ xObjectComp->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
xSource = NULL;
mpTableData.reset();
}