https://bugs.documentfoundation.org/show_bug.cgi?id=115221
--- Comment #5 from Julien Nabet <[email protected]> ---
Noel: this part seems weird to me:
@@ -322,14 +322,11 @@ SwViewShell::~SwViewShell()
delete mpImp; // Delete first, so that the LayoutViews are destroyed.
mpImp = nullptr; // Set to zero, because ~SwFrame relies on it.
- if ( mpDoc )
+ if ( mxDoc.get() )
{
- if( !mpDoc->release() )
- {
- delete mpDoc;
- mpDoc = nullptr;
- }
- else
+ auto x = mxDoc->getReferenceCount();
+ mxDoc.clear();
+ if( x > 1 )
GetLayout()->ResetNewLayout();
}
Indeed, with mxDoc, we don't call acquire anymore, so getReferenceCount is
never > 1 + we shouldn't call clear() on mxDoc manually, should we?
I thought about this patch then:
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 2998ffb131f8..6ae4f8a07a62 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -324,10 +324,7 @@ SwViewShell::~SwViewShell()
if ( mxDoc.get() )
{
- auto x = mxDoc->getReferenceCount();
- mxDoc.clear();
- if( x > 1 )
- GetLayout()->ResetNewLayout();
+ GetLayout()->ResetNewLayout();
}
delete mpOpt;
what do you think?
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs