[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - chart2/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Thu Dec 12 00:13:35 UTC 2019


 chart2/source/controller/main/ChartWindow.cxx                      |    1 +
 chart2/source/controller/sidebar/ChartSidebarModifyListener.cxx    |    7 ++++++-
 chart2/source/controller/sidebar/ChartSidebarSelectionListener.cxx |    7 +++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit d4c52ebce80e6ea9dbfa0ca47b50272fab71c546
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Wed Dec 11 18:19:43 2019 -0500
Commit:     Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Thu Dec 12 01:12:45 2019 +0100

    chart2: clear listener parents in dispose
    
    Change-Id: Icdab125589ab0f55255f683a1ea39e036de661b1
    Reviewed-on: https://gerrit.libreoffice.org/84997
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 57f245fe8db4..41e2664d1e9d 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -75,6 +75,7 @@ ChartWindow::~ChartWindow()
 
 void ChartWindow::dispose()
 {
+    m_pWindowController = nullptr;
     m_pViewShellWindow.clear();
     vcl::Window::dispose();
 }
diff --git a/chart2/source/controller/sidebar/ChartSidebarModifyListener.cxx b/chart2/source/controller/sidebar/ChartSidebarModifyListener.cxx
index b000e55c5aa6..0fa0b793b5b6 100644
--- a/chart2/source/controller/sidebar/ChartSidebarModifyListener.cxx
+++ b/chart2/source/controller/sidebar/ChartSidebarModifyListener.cxx
@@ -27,12 +27,17 @@ ChartSidebarModifyListener::~ChartSidebarModifyListener()
 
 void ChartSidebarModifyListener::modified(const css::lang::EventObject& /*rEvent*/)
 {
-    mpParent->updateData();
+    if (mpParent)
+        mpParent->updateData();
 }
 
 void ChartSidebarModifyListener::disposing(const css::lang::EventObject& /*rEvent*/)
 {
+    if (!mpParent)
+        return;
+
     mpParent->modelInvalid();
+    mpParent = nullptr;
 }
 
 } }
diff --git a/chart2/source/controller/sidebar/ChartSidebarSelectionListener.cxx b/chart2/source/controller/sidebar/ChartSidebarSelectionListener.cxx
index 19f4335e0b49..65d7bc9ce350 100644
--- a/chart2/source/controller/sidebar/ChartSidebarSelectionListener.cxx
+++ b/chart2/source/controller/sidebar/ChartSidebarSelectionListener.cxx
@@ -41,6 +41,9 @@ ChartSidebarSelectionListener::~ChartSidebarSelectionListener()
 
 void ChartSidebarSelectionListener::selectionChanged(const css::lang::EventObject& rEvent)
 {
+    if (!mpParent)
+        return;
+
     bool bCorrectObjectSelected = false;
 
     css::uno::Reference<css::frame::XController> xController(rEvent.Source, css::uno::UNO_QUERY);
@@ -66,7 +69,11 @@ void ChartSidebarSelectionListener::selectionChanged(const css::lang::EventObjec
 
 void ChartSidebarSelectionListener::disposing(const css::lang::EventObject& /*rEvent*/)
 {
+    if (!mpParent)
+        return;
+
     mpParent->SelectionInvalid();
+    mpParent = nullptr;
 }
 
 void ChartSidebarSelectionListener::setAcceptedTypes(const std::vector<ObjectType>& aTypes)


More information about the Libreoffice-commits mailing list