diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-02-01 12:08:34 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-02-02 09:42:38 +0100 |
commit | a74590e4b4475253bd7752738e570cdafe45e674 (patch) | |
tree | 84142035e96aef7f9cb36da3efb1dbaae547fb56 /sc | |
parent | 1037e3759bf178b52d16c12a811717f94ab9950a (diff) |
Don't recycle DocumentInserter, create a new one every time
After all, everyone else using DocumentInserter across the codebase
does the same.
For KDE4, an attempt to reuse the same filepicker dialog sporadically
crashes in the depths of (old-ish, possibly buggy) libQt due to nested
event loop and/or recursive repaints.
(crash scenario: Calc > Sheet > Link to external data > Browse > double-click
a file > Browse again > Kaboom!)
Change-Id: Ib494203abd07873919b8394a442f09c5329d237c
Reviewed-on: https://gerrit.libreoffice.org/49082
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/linkarea.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/linkarea.cxx | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/sc/source/ui/inc/linkarea.hxx b/sc/source/ui/inc/linkarea.hxx index 245ad1c34769..e0fef1f20f9e 100644 --- a/sc/source/ui/inc/linkarea.hxx +++ b/sc/source/ui/inc/linkarea.hxx @@ -46,7 +46,7 @@ private: VclPtr<OKButton> m_pBtnOk; ScDocShell* pSourceShell; - sfx2::DocumentInserter* pDocInserter; + std::unique_ptr<sfx2::DocumentInserter> pDocInserter; SfxObjectShellRef aSourceRef; diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index dab027b2f954..430af73633f2 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -83,8 +83,7 @@ void ScLinkedAreaDlg::dispose() IMPL_LINK_NOARG(ScLinkedAreaDlg, BrowseHdl, Button*, void) { - if ( !pDocInserter ) - pDocInserter = new sfx2::DocumentInserter(this, ScDocShell::Factory().GetFactoryName()); + pDocInserter.reset( new sfx2::DocumentInserter(this, ScDocShell::Factory().GetFactoryName()) ); pDocInserter->StartExecuteModal( LINK( this, ScLinkedAreaDlg, DialogClosedHdl ) ); } |