sfx2/source/doc/objstor.cxx |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit e45034214fc686e59c76480489421e1dec291584
Author:     Mike Kaganski <[email protected]>
AuthorDate: Thu Feb 1 13:35:43 2024 +0600
Commit:     Mike Kaganski <[email protected]>
CommitDate: Tue Feb 6 16:31:44 2024 +0600

    tdf#159496: clear mxObjectContainer in PrepareSecondTryLoad_Impl
    
    The problem here is that the object container has own reference to the
    storage object. In SfxBaseModel::load, when preparing for a second try,
    the storage gets disposed, and a cleanup is performed; but previously,
    the reference to the disposed storage was used in the object container,
    and thus generated a failure when it was used to import the OLE.
    
    Clearing it allows to re-create it properly, with the updated storage.
    
    Change-Id: I08b7503d79240ccc51b253fe1f4e99a0232995b1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162866
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 9ef664d1cb2f..ead00ade0721 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -380,6 +380,7 @@ void SfxObjectShell::PrepareSecondTryLoad_Impl()
 {
     // only for internal use
     pImpl->m_xDocStorage.clear();
+    pImpl->mxObjectContainer.reset();
     pImpl->m_bIsInit = false;
     ResetError();
 }

Reply via email to