diff options
authorNoel Grandin <>2018-01-26 10:29:43 +0200
committerMiklos Vajna <>2018-01-30 11:26:04 +0100
commit9e7344ae5776117e94684713767fae1b0afbb6b9 (patch)
parent697359f63e392a73fe3c34635819706a93e5c6b1 (diff)
tdf#115221 crash in printing and comment
not wonderfully happy with this fix, because we're changing the delete ordering here, but the origin of this bug was commit a754294ac7a902fe96fbbd6b8b6824a360d6b248 use rtl::Reference in SwDocFac instead of manual acquire/releas and commit cc483d0470dbf0d01e4da818b148ff0b851c5187 (patch) tdf#112292 - fix memory leak and use more auto ref counting in sw so the delete ordering was obviously messed up in those already, and we have such a morass of callbacks here, I can't see where else to fix it. I tried to add a couple more "getDoc() != nullptr" checks, but we still ended up crashing with an SwViewShell that had a bad pLayoutAccess pointer. Change-Id: I4aa39d58ae25bed41e3fd2c32c6d53659012ec10 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Noel Grandin <> (cherry picked from commit de9bcd167b059e00818304626c0cadaa330738a4) Reviewed-on: Reviewed-by: Miklos Vajna <>
1 files changed, 1 insertions, 3 deletions
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 2998ffb131f8..4c74acecdd09 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -324,9 +324,7 @@ SwViewShell::~SwViewShell()
if ( mxDoc.get() )
- auto x = mxDoc->getReferenceCount();
- mxDoc.clear();
- if( x > 1 )
+ if( mxDoc->getReferenceCount() > 1 )