diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-04 13:30:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-05 13:49:22 +0200 |
commit | cc483d0470dbf0d01e4da818b148ff0b851c5187 (patch) | |
tree | 8775e63c99cca6d0d44c0f2820d859691edb4cfa /sw/inc/viewsh.hxx | |
parent | 74977861a63c920f9b49e90087cac9a841392729 (diff) |
tdf#112292 - fix memory leak and use more auto ref counting in sw
this bug was introduced in
commit a754294ac7a902fe96fbbd6b8b6824a360d6b248
use rtl::Reference in SwDocFac instead of manual acquire/release
fix it by using automatic ref-counting (i.e. rtl::Reference) everywhere.
Note that the logic in SwViewShell::~SwViewShell is somewhat
interesting.
From my reading of it, it was previously potentially calling
getIDocumentLayoutAccess on an SwDoc that had just been deleted.
So if there is a problem with this commit I would look there first.
Change-Id: I95b6b7e7523689c8b56063af642c3a84cbdcd331
Reviewed-on: https://gerrit.libreoffice.org/43131
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc/viewsh.hxx')
-rw-r--r-- | sw/inc/viewsh.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 4a52059a5141..6688ff6cb0e9 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -183,7 +183,7 @@ protected: static vcl::DeleteOnDeinit< VclPtr<vcl::Window> > mpCareWindow; ///< Avoid this window. SwRect maVisArea; ///< The modern version of VisArea. - SwDoc *mpDoc; ///< The document; never 0. + rtl::Reference<SwDoc> mxDoc; ///< The document; never 0. sal_uInt16 mnStartAction; ///< != 0 if at least one Action is active. sal_uInt16 mnLockPaint; ///< != 0 if Paint is locked. @@ -286,7 +286,7 @@ public: const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const; - SwDoc *GetDoc() const { return mpDoc; } //Never 0. + SwDoc *GetDoc() const { return mxDoc.get(); } //Never 0. /** Provides access to the document setting interface */ |