diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-01-13 00:25:56 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-01-13 00:30:11 -0500 |
commit | eaa9f3425196260798e750a5564522dfa2b4c863 (patch) | |
tree | d72897e5e825c654427ed638387d6b4a83d4ed76 /sc/inc/dpobject.hxx | |
parent | Renamed data member. (diff) | |
download | core-eaa9f3425196260798e750a5564522dfa2b4c863.tar.gz core-eaa9f3425196260798e750a5564522dfa2b4c863.zip |
Use boost::ptr_list to store data cache instances to fix memory leak.
Diffstat (limited to 'sc/inc/dpobject.hxx')
-rw-r--r-- | sc/inc/dpobject.hxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index e0370772a988..3538f966362e 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -37,6 +37,7 @@ #include "pivot.hxx" #include <com/sun/star/sheet/XDimensionsSupplier.hpp> +#include <boost/ptr_container/ptr_list.hpp> #include <boost/shared_ptr.hpp> //------------------------------------------------------------------ @@ -262,7 +263,9 @@ class ScDPCollection : public ScCollection { private: ScDocument* pDoc; - ::std::list<ScDPTableDataCache*> maDPDataCaches; + + typedef ::boost::ptr_list<ScDPTableDataCache> DataCachesType; + DataCachesType maDPDataCaches; public: ScDPCollection(ScDocument* pDocument); ScDPCollection(const ScDPCollection& r); @@ -288,9 +291,13 @@ public: bool HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const; ScDPTableDataCache* GetDPObjectCache( long nID ); - ScDPTableDataCache* GetUsedDPObjectCache ( ScRange rRange ); + ScDPTableDataCache* GetUsedDPObjectCache ( const ScRange& rRange ); long AddDPObjectCache( ScDPTableDataCache* pData ); void RemoveDPObjectCache( long nID ); + + /** + * Get an available, unique ID value for datapilot data cache. + */ long GetNewDPObjectCacheId (); }; |