summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@allotropia.de>2024-12-12 10:55:50 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2024-12-19 12:21:55 +0100
commit068bbb0163268319e2efb27df2c6942444e50806 (patch)
treea15d2d8483fdc1fab9dba6152ca8120bf4d070d7
parent46c749ba793edfc4a5668c86ce1143496e868012 (diff)
sd: keep a non-owning pointer to the OverridingShell
... instead of keeping an owning shared_ptr To fix the ubsan build error <https://ci.libreoffice.org/job/lo_ubsan/3385/> Which appears to be caused from EventMultiplexer::CallListeners triggering a NotesPanelView to be deleted, and then notifying that just-deleted NotesPanelView, see <https://gerrit.libreoffice.org/c/core/+/177686/2#message-857c0180ae3e6572534d3bcd40f32000d434cc3d> Change-Id: I05e67dfeab093e7549e9b2ec4caf4a95dc743627 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178348 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Reviewed-by: Sarper Akdemir <sarper.akdemir@allotropia.de> (cherry picked from commit c1473de894b17f113fcb6c81f82592434e272a8c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178552 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sd/source/ui/view/ViewShellManager.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx
index a82a1be2dc82..0e6076efb1ce 100644
--- a/sd/source/ui/view/ViewShellManager.cxx
+++ b/sd/source/ui/view/ViewShellManager.cxx
@@ -117,7 +117,7 @@ public:
void DeactivateSubShell (const SfxShell& rParentShell, ShellId nId);
void RemoveOverridingMainShell();
void SetOverridingShell(const std::shared_ptr<ViewShell>& pViewShell);
- const std::shared_ptr<ViewShell> & GetOverridingShell();
+ std::shared_ptr<ViewShell> GetOverridingShell();
void MoveToTop (const SfxShell& rParentShell);
SfxShell* GetShell (ShellId nId) const;
SfxShell* GetTopShell() const;
@@ -194,7 +194,7 @@ private:
SfxShell* mpTopShell;
SfxShell* mpTopViewShell;
- std::shared_ptr<ViewShell> mpOverridingShell;
+ std::weak_ptr<ViewShell> mpOverridingShell;
void UpdateShellStack();
@@ -626,9 +626,9 @@ void ViewShellManager::Implementation::DeactivateSubShell (
DestroySubShell(aDescriptor);
}
-const std::shared_ptr<ViewShell> & ViewShellManager::Implementation::GetOverridingShell()
+std::shared_ptr<ViewShell> ViewShellManager::Implementation::GetOverridingShell()
{
- return mpOverridingShell;
+ return mpOverridingShell.lock();
}
void ViewShellManager::Implementation::RemoveOverridingMainShell()