[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 14 13:22:51 UTC 2019


 vcl/unx/gtk3/gtk3gtkinst.cxx |   28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

New commits:
commit de2cb96d5f9bb3c831fd136062582b4c11a003d1
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Oct 14 13:03:15 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Oct 14 15:22:03 2019 +0200

    assert fires after help hides find & replace dialog
    
    Change-Id: I72db53711322de9420fdb097ac60dda35f1ec5d8
    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>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index b1d3eed73097..b8ceadda4e0c 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -4023,7 +4023,7 @@ public:
 
     virtual bool runAsync(std::shared_ptr<weld::DialogController> rDialogController, const std::function<void(sal_Int32)>& func) override
     {
-        assert(!m_nResponseSignalId && !m_nCancelSignalId);
+        assert(!m_nResponseSignalId && !m_nCancelSignalId && !m_nSignalDeleteId);
 
         m_xDialogController = rDialogController;
         m_aFunc = func;
@@ -4042,7 +4042,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 && !m_nCancelSignalId);
+        assert(!m_nResponseSignalId && !m_nCancelSignalId && !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.
@@ -4223,12 +4223,7 @@ public:
 
         if (m_nCloseSignalId)
             g_signal_handler_disconnect(m_pDialog, m_nCloseSignalId);
-        if (m_nResponseSignalId)
-            g_signal_handler_disconnect(m_pDialog, m_nResponseSignalId);
-        if (m_nCancelSignalId)
-            g_signal_handler_disconnect(m_pDialog, m_nCancelSignalId);
-        if (m_nSignalDeleteId)
-            g_signal_handler_disconnect(m_pDialog, m_nSignalDeleteId);
+        assert(!m_nResponseSignalId && !m_nCancelSignalId && !m_nSignalDeleteId);
     }
 };
 
@@ -5954,6 +5949,23 @@ void GtkInstanceDialog::asyncresponse(gint ret)
         m_aDialogRun.dec_modal_count();
     hide();
     m_aFunc(GtkToVcl(ret));
+
+    if (m_nResponseSignalId)
+    {
+        g_signal_handler_disconnect(m_pDialog, m_nResponseSignalId);
+        m_nResponseSignalId = 0;
+    }
+    if (m_nCancelSignalId)
+    {
+        g_signal_handler_disconnect(m_pDialog, m_nCancelSignalId);
+        m_nCancelSignalId = 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