[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 25 10:39:38 UTC 2019


 vcl/unx/gtk3/gtk3gtkinst.cxx |   24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

New commits:
commit b5c76e38dab228180210faa479d2a5ac8b451173
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Oct 14 13:03:15 2019 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Mon Nov 25 11:38:54 2019 +0100

    assert fires after help hides find & replace dialog
    
    Reviewed-on: https://gerrit.libreoffice.org/80769
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit de2cb96d5f9bb3c831fd136062582b4c11a003d1)
    
    Change-Id: I72db53711322de9420fdb097ac60dda35f1ec5d8
    Reviewed-on: https://gerrit.libreoffice.org/83522
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index ae958cbe985e..194d669cdedf 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3202,7 +3202,7 @@ public:
 
     virtual bool runAsync(std::shared_ptr<weld::DialogController> rDialogController, const std::function<void(sal_Int32)>& func) override
     {
-        assert(!m_nResponseSignalId);
+        assert(!m_nResponseSignalId && !m_nSignalDeleteId);
 
         m_xDialogController = rDialogController;
         m_aFunc = func;
@@ -3218,7 +3218,7 @@ public:
     virtual bool runAsync(std::shared_ptr<Dialog> const & rxSelf, const std::function<void(sal_Int32)>& func) override
     {
         assert( rxSelf.get() == this );
-        assert(!m_nResponseSignalId);
+        assert(!m_nResponseSignalId && !m_nSignalDeleteId);
 
         // In order to store a shared_ptr to ourself, we have to have been constructed by make_shared,
         // which is that rxSelf enforces.
@@ -3404,11 +3404,9 @@ public:
             m_aHiddenWidgets.clear();
         }
 
-        g_signal_handler_disconnect(m_pDialog, m_nCloseSignalId);
-        if (m_nResponseSignalId)
-            g_signal_handler_disconnect(m_pDialog, m_nResponseSignalId);
-        if (m_nSignalDeleteId)
-            g_signal_handler_disconnect(m_pDialog, m_nSignalDeleteId);
+        if (m_nCloseSignalId)
+            g_signal_handler_disconnect(m_pDialog, m_nCloseSignalId);
+        assert(!m_nResponseSignalId && !m_nSignalDeleteId);
     }
 };
 
@@ -4857,6 +4855,18 @@ void GtkInstanceDialog::asyncresponse(gint ret)
 
     hide();
     m_aFunc(GtkToVcl(ret));
+
+    if (m_nResponseSignalId)
+    {
+        g_signal_handler_disconnect(m_pDialog, m_nResponseSignalId);
+        m_nResponseSignalId = 0;
+    }
+    if (m_nSignalDeleteId)
+    {
+        g_signal_handler_disconnect(m_pDialog, m_nSignalDeleteId);
+        m_nSignalDeleteId = 0;
+    }
+
     m_aFunc = nullptr;
     // move the self pointer, otherwise it might be de-allocated by time we try to reset it
     std::shared_ptr<weld::Dialog> me = std::move(m_xRunAsyncSelf);


More information about the Libreoffice-commits mailing list