diff options
-rw-r--r-- | sfx2/inc/sfx2/docfile.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index 5aef2f2e1e7d..fcf7351f9c9f 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -71,6 +71,9 @@ class SFX2_DLLPUBLIC SfxMedium : public SvRefBase public: SfxMedium(); + /** + * @param pSet Takes ownership + */ SfxMedium( const String &rName, StreamMode nOpenMode, const SfxFilter *pFilter = 0, diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index d88ecb7e9825..1e8a83274e85 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -375,8 +375,8 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String if ( !xDoc.Is() ) xDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName() ); + //pMedium takes ownership of pSet SfxMedium *pMedium = new SfxMedium( rFileName, STREAM_STD_READ, pFilter, pSet ); - delete pSet; if(!xDoc->DoLoad(pMedium)) { ErrCode nErrCode = xDoc->GetErrorCode(); |